Adyen Payment 4.2.3 #73
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2+' | |
- 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 | |
prepare-matrix: | |
needs: run | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
# Step 1: Fetch the newest Shopware version from Dockware | |
- name: Fetch Newest Shopware Version | |
id: fetch-newest-version | |
run: | | |
newest_tag=$(curl -s "https://hub.docker.com/v2/repositories/dockware/play/tags?page_size=100" | \ | |
jq -r '.results[].name' | \ | |
grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | \ | |
sort -V | \ | |
tail -n 1) | |
echo "NEWEST_DOCKWARE_TAG=$newest_tag" >> $GITHUB_ENV | |
echo "Newest Shopware tag is: $newest_tag" | |
# Step 2: Create Dynamic Matrix | |
- name: Create Dynamic Matrix | |
id: set-matrix | |
run: | | |
echo "Creating dynamic matrix..." | |
matrix_json=$(jq -c -n \ | |
--arg shopware_v1 "6.4.0.0" \ | |
--arg shopware_v2 "$NEWEST_DOCKWARE_TAG" \ | |
'{ | |
include: [ | |
{shopware_version: $shopware_v1}, | |
{shopware_version: $shopware_v2} | |
] | |
}') | |
echo "::set-output name=matrix::$matrix_json" | |
echo "Generated matrix: $matrix_json" | |
env: | |
NEWEST_DOCKWARE_TAG: ${{ env.NEWEST_DOCKWARE_TAG }} | |
build-plugin: | |
needs: prepare-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} | |
steps: | |
# Step 3: Checkout repository | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Step 5: Log in to GitHub Container Registry | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Step 6: Build and Push Docker Image | |
- name: Push Docker Image for Shopware ${{ matrix.shopware_version }} | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/adyen/adyen-shopware6:${{ matrix.shopware_version }}-${{ github.event.release.tag_name }} | |
build-args: | | |
SHOPWARE_TAG=${{ matrix.shopware_version }} | |
RELEASE_TAG=${{ github.event.release.tag_name }} |