Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-8954] Automate the Shopware Marketplace zip file creation as release asset #500

Merged
merged 75 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9dcd59f
Added new workflow file and script for creating zip
May 14, 2024
c34651b
Fixed syntax in yml file
May 14, 2024
f012a64
Update the path to prepare script in yml file
May 14, 2024
65ac7a2
Add a testing script with e2e file
May 14, 2024
4b12dba
Update the file path syntax
May 14, 2024
6829e3c
Update working directory path
May 14, 2024
6da0145
Try something new
May 14, 2024
50c8b6f
Try something new with the zip path
May 14, 2024
7008ec9
hopefully this fixed the path
May 14, 2024
18c46d3
hopefully this fixed the path - 2
May 14, 2024
b1d172d
hopefully this fixed the path - 3
May 14, 2024
826443e
hopefully this fixed the path - 4
May 14, 2024
76ef96d
hopefully this fixed the path - 5
May 14, 2024
2af68e5
last trial of the day
May 14, 2024
f736331
move zip file inside pwd
May 14, 2024
f07e5bf
Finish up
May 14, 2024
c63dadf
Remove copy
May 14, 2024
29376d8
Update comments
May 14, 2024
bd2136a
Add upload asset into workflow
May 15, 2024
d0ec4d2
try to use the upload artifact action for uploading release asset
May 15, 2024
bb6387e
path var update
May 15, 2024
89c04c6
Action update
May 16, 2024
fe0525e
add tag
May 16, 2024
854293c
always
May 16, 2024
ef522e1
try latest action
May 16, 2024
c4b66af
try another one
May 16, 2024
9d8a438
update input variable
May 16, 2024
16b5f74
try CLI
May 16, 2024
59160f1
fix syntax
May 16, 2024
1ee6e07
fix syntax
May 16, 2024
594c409
Merge remote-tracking branch 'origin/ECP-8954' into ECP-8954
May 16, 2024
e8b6adb
add token
May 16, 2024
aa58933
remove @
May 16, 2024
5497828
find the file
May 16, 2024
6641f7e
trying to user form data.
May 16, 2024
0bda11d
setting the content type and using the upload url.
May 16, 2024
3bd2934
oops.. upload_url instead of release id
May 16, 2024
55a376c
fight the zip corruption
May 16, 2024
0fce5dc
fight the zip corruption -1
May 16, 2024
083d0c1
Update checkout version in mail.yml to get rid of deprecation warnings
May 16, 2024
47172a4
remove usage of set-output
May 16, 2024
bc0232a
Test and revert
May 16, 2024
bec65a1
revert url var too
May 16, 2024
45f7965
test env vars
May 16, 2024
2f5beed
change syntax
May 16, 2024
d4e7b08
again
May 16, 2024
0ea453b
change mime type
May 16, 2024
5c66fa4
raw field instead of field
May 16, 2024
3f0e80e
back to the basics..
May 16, 2024
52b0698
added ls again to check (and data key)
May 16, 2024
6d8eb5f
try something new
May 17, 2024
5721831
try upload with cli command using tag-name
May 17, 2024
8ec2c28
Clean up and try upload with cli command using tag-name - 2
May 17, 2024
b6e707d
Go back to old method
May 17, 2024
58a34be
See if Readme file gets corrupted too on upload
May 17, 2024
49153a2
syntax fix
May 17, 2024
05743a8
rearrange commented code
May 17, 2024
cdcb548
syntax fix again
May 17, 2024
40dac73
Check for readme
May 17, 2024
ca15551
Correct file type
May 17, 2024
bfe323f
Now try the same method for the zip
May 17, 2024
118721a
Oops! forgot to compile the zip
May 17, 2024
ae4619b
Since it finally works - optimize code
May 17, 2024
e9bfff6
Finalise
May 17, 2024
aaff0b1
Update trigger to 'release'
May 17, 2024
324b913
Remove the push trigger
May 17, 2024
eccc5ce
Merged development into branch
May 17, 2024
83a76a9
Apply suggestions from review
May 17, 2024
c775e52
Remove missed commented code
May 21, 2024
7731dcb
Create a zip file for test and use the ref name instead of 'latest' f…
May 21, 2024
c24eb9d
Remove 'workflow_dispatch' trigger and get a zip file with 'push' tri…
May 21, 2024
3f952b2
Remove 'push' trigger and add back the usage of ref name
May 21, 2024
faaa75f
test the trigger type 'edited' for release
May 21, 2024
15ba25f
test the trigger type 'published' for release
May 21, 2024
ba3e34b
[ECP-8954] Use tag name directly
candemiralp May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
php-version: ${{ matrix.php-version }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/scripts/prepare-release-asset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Create a copy of the plugin directory
cd ..
cp -r adyen-shopware6 AdyenPaymentShopware6

# Remove Shopware dependencies
composer remove shopware/core --working-dir=./AdyenPaymentShopware6
composer remove shopware/storefront --working-dir=./AdyenPaymentShopware6

# Remove composer.lock again and vendor directory
rm AdyenPaymentShopware6/composer.lock
rm -rf AdyenPaymentShopware6/vendor

# Install dependencies
composer install --no-dev --working-dir=./AdyenPaymentShopware6

# Copy original the composer.json file
cp adyen-shopware6/composer.json AdyenPaymentShopware6/.

# Zip the plugin directory
zip -r AdyenPaymentShopware6.zip AdyenPaymentShopware6/ ;

# Move the zip file to plugin folder
mv AdyenPaymentShopware6.zip adyen-shopware6

# Cleanup the zip installation
zip -d AdyenPaymentShopware6.zip __MACOSX/\* ; zip -d AdyenPaymentShopware6.zip *.git*

# Go back to workflow's root directory
cd adyen-shopware6
22 changes: 22 additions & 0 deletions .github/workflows/upload-release-asset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
release:
types: [published]

name: Upload Shopware 6 Marketplace asset

jobs:
run:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare release artifact
run: .github/workflows/scripts/prepare-release-asset.sh

- name: Upload asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} AdyenPaymentShopware6.zip --clobber
Loading