From f4d81c7777d49387ef292f28c61c271fa6b32682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BIDAULT?= Date: Tue, 19 Nov 2024 10:14:55 +0100 Subject: [PATCH 1/3] Deployment workflow PS 1.6 --- .github/actions/auth-gcp/action.yml | 86 +++++++++++++++++++ .github/workflows/build-release.yml | 96 --------------------- .github/workflows/deploy.yml | 98 ++++++++++++++++++++++ .github/workflows/js.yml | 1 + .github/workflows/php.yml | 15 ++-- .github/workflows/push-to-bucket.yml | 62 ++++++++++++++ .github/workflows/push-to-repository.yml | 85 +++++++++++++++++++ .github/workflows/update-release-draft.yml | 68 +++++++++++++++ 8 files changed, 410 insertions(+), 101 deletions(-) create mode 100644 .github/actions/auth-gcp/action.yml delete mode 100644 .github/workflows/build-release.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/push-to-bucket.yml create mode 100644 .github/workflows/push-to-repository.yml create mode 100644 .github/workflows/update-release-draft.yml diff --git a/.github/actions/auth-gcp/action.yml b/.github/actions/auth-gcp/action.yml new file mode 100644 index 000000000..74982c126 --- /dev/null +++ b/.github/actions/auth-gcp/action.yml @@ -0,0 +1,86 @@ +name: 'Auth GCP' +description: 'Auth gcp, can login to docker artifact registry or install the sdk' +inputs: + auth-mode: + description: 'Authentication mode (workload-federation or json-file)' + required: true + type: choice + options: + - workload-federation + - json-file + default: 'workload-federation' + registry-login: + required: false + type: bool + default: false + credentials-json: + required: false + type: string + setup-gcloud: + required: false + type: bool + default: false + service-account: + required: false + description: Service account email + type: string + provider: + required: false + description: gcp workload identity provider + type: string + gcp-registry-region: + required: false + description: docker registry gcp + default: "europe-west1-docker.pkg.dev" + type: string + sdk-version: + required: true + description: which version of google dsl you want to suer + default: '>=457.0.0' + type: string + gke-cluster-name: + required: false + description: 'If you put the cluster name in this variable it will activate auth to make kubectl' + default: '' + type: string + cluster-region: + required: false + description: 'Cluster region' + type: choice + options: + - europe-west1 + default: 'europe-west1' + +runs: + using: 'composite' + steps: + - name: Authenticate to Google Cloud with Workload Federation 🔐 + if: ${{ inputs.auth-mode == 'workload-federation' }} + uses: google-github-actions/auth@v2 + with: + workload_identity_provider: ${{ inputs.provider }} + service_account: ${{ inputs.service-account }} + + - name: Authenticate to Google Cloud with a JSON file 🔐 (THIS IS DEPRECATED ❌) + if: ${{ inputs.auth-mode == 'json-file' }} + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ inputs.credentials-json }} + + - name: Setting up gcloud SDK 🛠 + if: ${{ inputs.setup-gcloud == 'true' }} + uses: google-github-actions/setup-gcloud@v2 + with: + version: ${{ inputs.sdk-version }} + + - name: Login to Docker artifact registry đŸŗ + if: ${{ inputs.registry-login == 'true' }} + shell: bash + run: gcloud auth configure-docker ${{ inputs.gcp-registry-region }} + + - name: Add cluster authentification 🧊 + if: ${{ inputs.gke-cluster-name != '' }} + uses: 'google-github-actions/get-gke-credentials@v2' + with: + cluster_name: '${{ inputs.gke-cluster-name }}' + location: '${{ inputs.cluster-region }}' diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index 9f2069689..000000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Build & Release draft - -on: - push: - branches: - - 'prestashop/1.6.1.x' - pull_request: - types: [ opened, reopened, synchronize, edited ] - -env: - GCLOUD_TOKEN_PATH: ./token.json - -jobs: - deploy: - name: build dependencies & create artifact - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.0.0 - - - name: Gcloud auth and write env file - run: | - echo $GOOGLE_APPLICATION_CREDENTIALS > $GCLOUD_TOKEN_PATH - gcloud auth activate-service-account --key-file=$GCLOUD_TOKEN_PATH - gcloud container clusters get-credentials $GCLOUD_CLUSTER \ - --zone europe-west1-c --project $GCLOUD_PROJECT - gcloud beta secrets versions access latest --project=$GCLOUD_PROJECT --secret="checkout-module" > .env - rm $GCLOUD_TOKEN_PATH - env: - GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCLOUD_CREDENTIAL_PRODUCTION }} - GCLOUD_TOKEN_PATH: ${{ env.GCLOUD_TOKEN_PATH }} - GCLOUD_CLUSTER: ${{ secrets.GCLOUD_CLUSTER }} - GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT_PRODUCTION }} - - - name: Build JS dependencies - uses: PrestaShopCorp/github-action-build-js/12@v1.0 - with: - cmd: npm - path: ./ - - - name: Install composer dependencies - run: composer install --no-dev -o - - - name: Clean-up project - uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0 - - - name: Clean-up node_modules directory - run: sudo rm -rf node_modules - - - name: Create & upload artifact - uses: actions/upload-artifact@v1 - - with: - name: ${{ github.event.repository.name }} - path: ../ - update_release_draft: - runs-on: ubuntu-latest - needs: [deploy] - if: github.event_name == 'push' - steps: - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: ${{ github.event.repository.name }} - - id: release_info - uses: toolmantim/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get module version - id: get_version - run: | - echo ::set-output name=VERSION::$(grep "const VERSION = " ./ps_checkout.php | sed "s/.*'\(.*\)'.*/\1/") - - name: Prepare for Release - run: | - cd ${{ github.event.repository.name }} - zip -r ${{ github.event.repository.name }}-${{ steps.get_version.outputs.VERSION }}.zip ${{ github.event.repository.name }} -x '*.git*' - - name: Clean existing assets - shell: bash - run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` - for asset in $assets - do - bin/hub api -X DELETE $asset - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to GitHub Release - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.release_info.outputs.upload_url }} - asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}-${{ steps.get_version.outputs.VERSION }}.zip - asset_name: ${{ github.event.repository.name }}-${{ steps.get_version.outputs.VERSION }}.zip - asset_content_type: application/zip diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..ac0731c4a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,98 @@ +name: PrestaShop 1.6 - Deployment + +on: + pull_request: + types: [opened, reopened, synchronize, edited, labeled] + push: + tags: + - v6.* + branches: + - prestashop/1.6.x + +jobs: + zip-name-matrix: + name: Generate zip file name + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + env: + - integration + - preproduction + outputs: + integration: ${{ steps.zip-name.outputs.integration }} + preproduction: ${{ steps.zip-name.outputs.preproduction }} + production: ${{ github.event.repository.name }} + + steps: + - name: Generate zip file name + id: zip-name + run: | + date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S') + echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT" + env: + ENV: ${{ matrix.env }} + REPOSITORY: ${{ github.event.repository.name }} + PS_VERSION: ps6 + PR_NUMBER: pr${{ github.event.number }} + + push-to-repository-matrix: + name: ${{ matrix.env.upper }} - Push to GitHub repository + needs: [zip-name-matrix] + strategy: + fail-fast: false + matrix: + env: + - upper: INTEGRATION + lower: integration + triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }} + - upper: PREPRODUCTION + lower: preproduction + triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }} + - upper: PRODUCTION + lower: production + triggered: ${{ github.event_name == 'push' }} + uses: ./.github/workflows/push-to-repository.yml + with: + env-upper: ${{ matrix.env.upper }} + env-lower: ${{ matrix.env.lower }} + triggered: ${{ matrix.env.triggered }} + zip-name: ${{ needs.zip-name-matrix.outputs[matrix.env.lower] }} + repository-name: ${{ github.event.repository.name }} + secrets: inherit + + push-to-bucket-matrix: + name: ${{ matrix.env.upper }} - Push to GCP bucket storage + needs: [zip-name-matrix, push-to-repository-matrix] + strategy: + fail-fast: false + matrix: + env: + - lower: integration + upper: INTEGRATION + triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }} + - lower: preproduction + upper: PREPRODUCTION + triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }} + - upper: PRODUCTION + lower: production + triggered: ${{ github.event_name == 'push' }} + uses: ./.github/workflows/push-to-bucket.yml + with: + env-upper: ${{ matrix.env.upper }} + env-lower: ${{ matrix.env.lower }} + triggered: ${{ matrix.env.triggered }} + zip-name: ${{ needs.zip-name-matrix.outputs[matrix.env.lower] }} + repository-name: ${{ github.event.repository.name }} + prestashop-version: ps6 + secrets: inherit + + update-release-draft: + name: PRODUCTION - Update release draft + needs: [push-to-repository-matrix] + uses: ./.github/workflows/update-release-draft.yml + with: + env-lower: production + triggered: ${{ github.event_name == 'push' }} + repository-name: ${{ github.event.repository.name }} + secrets: inherit diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 5ee41112c..a4361e382 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -4,6 +4,7 @@ jobs: js-linter: name: JS linter runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} steps: - name: Checkout uses: actions/checkout@v2.0.0 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9267eae86..75c2ec0c9 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -2,8 +2,8 @@ name: PHP tests on: push: branches: - - 'master' - - 'prestashop/1.6.1.x' + - "master" + - "prestashop/1.6.1.x" pull_request: types: [opened, reopened, synchronize, edited] @@ -11,6 +11,7 @@ jobs: header-stamp: name: Check license headers runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} steps: - name: Checkout uses: actions/checkout@v2 @@ -18,7 +19,7 @@ jobs: - name: Setup PHP 7.4 uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: "7.4" - name: Cache vendor folder uses: actions/cache@v1 @@ -39,6 +40,7 @@ jobs: php-linter: name: PHP Syntax check 5.6|7.1 runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} steps: - name: Checkout uses: actions/checkout@v2.0.0 @@ -49,6 +51,7 @@ jobs: php-cs-fixer: name: PHP-CS-Fixer runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} steps: - name: Checkout uses: actions/checkout@v2.0.0 @@ -57,9 +60,10 @@ jobs: phpstan: name: PHPStan runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} strategy: matrix: - presta-versions: ['1.6.1.0', '1.6.1.21'] + presta-versions: ["1.6.1.0", "1.6.1.21"] steps: - name: Checkout uses: actions/checkout@v2.0.0 @@ -81,11 +85,12 @@ jobs: - name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }}) run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }} - - name : Run PHPStan + - name: Run PHPStan run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan-PS-1.6.neon --error-format github phpunit: name: PHPUnit runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/push-to-bucket.yml b/.github/workflows/push-to-bucket.yml new file mode 100644 index 000000000..7fd3e3d68 --- /dev/null +++ b/.github/workflows/push-to-bucket.yml @@ -0,0 +1,62 @@ +name: Push to GCP bucket storage + +on: + workflow_call: + inputs: + env-upper: + required: true + type: string + env-lower: + required: true + type: string + triggered: + required: true + type: boolean + zip-name: + required: true + type: string + repository-name: + required: true + type: string + default: "ps_checkout" + prestashop-version: + required: true + type: string + +jobs: + push-to-bucket: + name: ${{ inputs.env-upper }} - Create zip file and push to GCP bucket storage + runs-on: ubuntu-latest + environment: ${{ inputs.env-lower }} + permissions: + id-token: write + contents: read + pull-requests: write + if: inputs.triggered == true + + steps: + - name: Checkout the repository 🎁 + uses: actions/checkout@v4 + + - name: Auth GCP 🔑 + uses: ./.github/actions/auth-gcp + with: + auth-mode: "workload-federation" + provider: ${{ secrets[format('WI_PROVIDER_V2_{0}', inputs.env-upper)] }} + service-account: ${{ secrets[format('WI_SA_V2_{0}', inputs.env-upper)] }} + registry-login: true + setup-gcloud: true + + - name: Download artifact 🚚 + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.zip-name }} + + - name: Prepare zip for push 👷 + run: | + cd ${{ inputs.repository-name }} + zip -r ../${{ inputs.zip-name }}.zip . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + - name: Push to GCP bucket storage 🛩ī¸ + shell: bash + run: | + gsutil cp ${{ inputs.zip-name }}.zip gs://ps-eu-w1-checkout-assets-${{ inputs.env-lower }}/zips/${{ inputs.prestashop-version }} diff --git a/.github/workflows/push-to-repository.yml b/.github/workflows/push-to-repository.yml new file mode 100644 index 000000000..321ea6c39 --- /dev/null +++ b/.github/workflows/push-to-repository.yml @@ -0,0 +1,85 @@ +name: Push to GitHub repository + +on: + workflow_call: + inputs: + env-upper: + required: true + type: string + env-lower: + required: true + type: string + triggered: + required: true + type: boolean + zip-name: + required: true + type: string + repository-name: + required: true + type: string + default: "ps_checkout" + +jobs: + push-to-repository: + name: ${{ inputs.env-upper }} - Create zip file and push to GitHub repository + runs-on: ubuntu-latest + environment: ${{ inputs.env-lower }} + permissions: + id-token: write + contents: read + pull-requests: write + if: inputs.triggered == true + + steps: + - name: Checkout the repository 🎁 + uses: actions/checkout@v4 + + - name: Auth GCP 🔑 + uses: ./.github/actions/auth-gcp + with: + auth-mode: "workload-federation" + provider: ${{ secrets[format('WI_PROVIDER_V2_{0}', inputs.env-upper)] }} + service-account: ${{ secrets[format('WI_SA_V2_{0}', inputs.env-upper)] }} + registry-login: true + setup-gcloud: true + + - name: Write .env file đŸŒŗ + run: gcloud --quiet beta secrets versions access latest --project=$GCP_PROJECT --secret="module-env" > .env + env: + GCP_PROJECT: ${{ secrets[format('GCP_PROJECT_{0}', inputs.env-upper)] }} + + - name: Install composer dependencies 👷 + run: composer install --no-dev -o + + - name: Create directory with repo name and move files 🏗ī¸ + run: | + repo_name="${{ inputs.repository-name }}" + mkdir "$repo_name" + shopt -s dotglob nullglob + for file in *; do + if [ "$file" != "$repo_name" ]; then + mv "$file" "$repo_name/" + fi + done + - name: Workaround actions/upload-artifact#176 🚧 + id: artifacts + run: | + echo "path=$(realpath ..)" >> "$GITHUB_OUTPUT" + - name: Create & upload artifact 🛩ī¸ + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.zip-name }} + path: ${{ steps.artifacts.outputs.path }} + include-hidden-files: true + retention-days: ${{ (inputs.env-lower == 'production' && 90) || 1 }} + + - name: Move files at root project 🏗ī¸ + run: | + cd "${{ inputs.repository-name }}" + shopt -s dotglob nullglob + for file in *; do + mv "$file" ../ + done + cd ../ + rm -Rf "${{ inputs.repository-name }}" diff --git a/.github/workflows/update-release-draft.yml b/.github/workflows/update-release-draft.yml new file mode 100644 index 000000000..2bb40f156 --- /dev/null +++ b/.github/workflows/update-release-draft.yml @@ -0,0 +1,68 @@ +name: Update release draft + +on: + workflow_call: + inputs: + env-lower: + required: true + type: string + triggered: + required: true + type: boolean + repository-name: + required: true + type: string + default: "ps_checkout" + +jobs: + update-release-draft: + name: PRODUCTION - Update release draft + runs-on: ubuntu-latest + environment: ${{ inputs.env-lower }} + permissions: + id-token: write + contents: read + pull-requests: write + if: inputs.triggered == true + env: + ZIP_NAME: ${{ inputs.repository-name }}.zip + + steps: + - name: Download artifact 🚚 + uses: actions/download-artifact@v4 + with: + name: ${{ env.ZIP_NAME }} + + - name: Release drafter 🏗ī¸ + id: release_info + uses: toolmantim/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + commitish: prestashop/1.7.x + + - name: Prepare zip for release 👷 + run: | + cd ${{ inputs.repository-name }} + zip -r ../${{ env.ZIP_NAME }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + - name: Clean existing assets â™ģī¸ + shell: bash + run: | + curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 + assets=`bin/hub api -t repos/${{ inputs.repository-name }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` + for asset in $assets + do + bin/hub api -X DELETE $asset + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to GitHub Release 🛩ī¸ + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release_info.outputs.upload_url }} + asset_path: ./${{ env.ZIP_NAME }} + asset_name: ${{ env.ZIP_NAME }} + asset_content_type: application/zip From 9648b6435dce9055e05c4601b86350c8b41b756d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BIDAULT?= Date: Tue, 19 Nov 2024 10:17:47 +0100 Subject: [PATCH 2/3] Deployment workflow PS 1.6 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e8991c05a..5692466b7 100755 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ ### Ignore integration settings ### .env .env.test +.env.* ### PrestaShop cache config_*.xml From ff70bbb7fc4880b9a1f3ccd56f45cd2d6d6c7efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BIDAULT?= Date: Tue, 19 Nov 2024 12:10:04 +0100 Subject: [PATCH 3/3] Push zip files at GCP bucket storage root --- .github/workflows/deploy.yml | 1 + .github/workflows/push-to-bucket.yml | 29 ++++++++++++++++++++-- .github/workflows/push-to-repository.yml | 2 ++ .github/workflows/update-release-draft.yml | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ac0731c4a..9e54eda34 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -85,6 +85,7 @@ jobs: zip-name: ${{ needs.zip-name-matrix.outputs[matrix.env.lower] }} repository-name: ${{ github.event.repository.name }} prestashop-version: ps6 + pr-number: pr${{ github.event.number }} secrets: inherit update-release-draft: diff --git a/.github/workflows/push-to-bucket.yml b/.github/workflows/push-to-bucket.yml index 7fd3e3d68..4258c21ce 100644 --- a/.github/workflows/push-to-bucket.yml +++ b/.github/workflows/push-to-bucket.yml @@ -22,11 +22,35 @@ on: prestashop-version: required: true type: string + pr-number: + required: true + type: string jobs: + bucket-zip-name: + name: Generate zip file name + runs-on: ubuntu-latest + outputs: + integration: ${{ inputs.zip-name }}.zip + preproduction: ${{ inputs.zip-name }}.zip + production: ${{ steps.zip-name.outputs.name }}.zip + + steps: + - name: Generate zip file name + id: zip-name + run: | + date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S') + echo "name=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT" + env: + ENV: production + REPOSITORY: ${{ inputs.repository-name }} + PS_VERSION: ${{ inputs.prestashop-version }} + PR_NUMBER: pr${{ inputs.pr-number }} + push-to-bucket: name: ${{ inputs.env-upper }} - Create zip file and push to GCP bucket storage runs-on: ubuntu-latest + needs: [bucket-zip-name] environment: ${{ inputs.env-lower }} permissions: id-token: write @@ -55,8 +79,9 @@ jobs: - name: Prepare zip for push 👷 run: | cd ${{ inputs.repository-name }} - zip -r ../${{ inputs.zip-name }}.zip . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + zip -r ../${{ needs.bucket-zip-name.outputs[inputs.env-lower] }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + - name: Push to GCP bucket storage 🛩ī¸ shell: bash run: | - gsutil cp ${{ inputs.zip-name }}.zip gs://ps-eu-w1-checkout-assets-${{ inputs.env-lower }}/zips/${{ inputs.prestashop-version }} + gsutil cp ${{ needs.bucket-zip-name.outputs[inputs.env-lower] }} gs://ps-eu-w1-checkout-assets-${{ inputs.env-lower }} diff --git a/.github/workflows/push-to-repository.yml b/.github/workflows/push-to-repository.yml index 321ea6c39..b8cf66020 100644 --- a/.github/workflows/push-to-repository.yml +++ b/.github/workflows/push-to-repository.yml @@ -62,10 +62,12 @@ jobs: mv "$file" "$repo_name/" fi done + - name: Workaround actions/upload-artifact#176 🚧 id: artifacts run: | echo "path=$(realpath ..)" >> "$GITHUB_OUTPUT" + - name: Create & upload artifact 🛩ī¸ uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/update-release-draft.yml b/.github/workflows/update-release-draft.yml index 2bb40f156..7ba2710ca 100644 --- a/.github/workflows/update-release-draft.yml +++ b/.github/workflows/update-release-draft.yml @@ -45,6 +45,7 @@ jobs: run: | cd ${{ inputs.repository-name }} zip -r ../${{ env.ZIP_NAME }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + - name: Clean existing assets â™ģī¸ shell: bash run: |