diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa244284..f22e6c46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/.github/workflows/scripts/prepare-release-asset.sh b/.github/workflows/scripts/prepare-release-asset.sh new file mode 100755 index 00000000..fa3c6442 --- /dev/null +++ b/.github/workflows/scripts/prepare-release-asset.sh @@ -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 diff --git a/.github/workflows/upload-release-asset.yml b/.github/workflows/upload-release-asset.yml new file mode 100644 index 00000000..22c45144 --- /dev/null +++ b/.github/workflows/upload-release-asset.yml @@ -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