v1.38.3-beta.2 #132
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
name: Publish | |
on: | |
release: | |
types: [published] | |
env: | |
NODE_VERSION: 20 | |
CDN_URL_ENV_NAME: PSX_FACEBOOK_CDN_URL | |
GLOUD_CDN_BUCKET: psxfacebook | |
GLOUD_SECRET_NAME: facebook-module | |
jobs: | |
build: | |
name: build dependencies & create artifact | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
cache-dependency-path: '_dev/package-lock.json' | |
- name: Install & build | |
working-directory: _dev | |
run: | | |
npm install | |
npm run build | |
- name: Install dev composer dependencies | |
run: composer install | |
- name: Generate index.php | |
run: vendor/bin/autoindex | |
- name: Install composer dependencies | |
run: composer install --no-dev -o | |
- name: Get tag | |
id: get_tag | |
run: | | |
echo TAG=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT | |
echo MAJOR=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 1) >> $GITHUB_OUTPUT | |
echo MINOR=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 2) >> $GITHUB_OUTPUT | |
echo PATCH=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 3) >> $GITHUB_OUTPUT | |
- name: Write .env file with specific CDN URL | |
if: "github.event.release.prerelease" | |
run: echo '${{env.CDN_URL_ENV_NAME}}=https://storage.googleapis.com/${{env.GLOUD_CDN_BUCKET}}/${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.${{ steps.get_tag.outputs.PATCH }}/js/' >> .env | |
- name: Clean-up project | |
uses: PrestaShopCorp/[email protected] | |
with: | |
paths: 'crowdin.yml' | |
- name: Create & upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: ./ | |
include-hidden-files: true | |
upload_release_asset_production: | |
name: Upload the production zip asset to the release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: ./${{ github.event.repository.name }} | |
- name: Prepare the production zip | |
run: | | |
zip -r ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip ${{ github.event.repository.name }} -x '*.git*' | |
- name: Publish the production zip | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip | |
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
upload_release_asset_integration: | |
name: Upload the integration zip asset to the release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: ./${{ github.event.repository.name }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
project_id: ${{ secrets.G_PROJECT_INTEGRATION }} | |
service_account_key: ${{ secrets.G_CREDENTIAL_INTEGRATION }} | |
export_default_credentials: true | |
- name: Copy env files | |
run: | | |
gcloud components install beta | |
gcloud beta secrets versions access latest --secret="${{env.GLOUD_SECRET_NAME}}" >> ./${{ github.event.repository.name }}/.env | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.G_CREDENTIAL_INTEGRATION }} | |
- name: Prepare the integration zip | |
run: | | |
zip -r ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_integration.zip ${{ github.event.repository.name }} -x '*.git*' | |
- name: Publish the integration zip | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_integration.zip | |
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_integration.zip | |
asset_content_type: application/zip | |
publish_to_marketplace: | |
name: Publish to the Marketplace | |
runs-on: ubuntu-latest | |
needs: upload_release_asset_production | |
if: github.event.release.prerelease == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download release asset | |
uses: dsaltares/[email protected] | |
with: | |
repo: ${{ github.event.repository.full_name }} | |
version: ${{ github.event.release.id }} | |
file: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip | |
token: ${{ secrets.JARVIS_TOKEN }} | |
- name: Prepare publishing tool | |
run: | | |
composer global require prestashop/publish-on-marketplace | |
- name: Release zip | |
run: | | |
~/.composer/vendor/bin/publish-on-marketplace --archive=$PWD/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip --metadata-json=$PWD/.github/mktp-metadata.json --changelog="${{ github.event.release.body }}" --debug | |
env: | |
MARKETPLACE_API_KEY: ${{ secrets.MARKETPLACE_API_KEY }} | |
publish_to_sentry_php: | |
runs-on: ubuntu-latest | |
if: github.event.release.prerelease == false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Sentry Release | |
uses: getsentry/[email protected] | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
with: | |
environment: production | |
version: ${{ github.ref }} |