Publish #1
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] | |
jobs: | |
create_artifact: | |
uses: ./.github/workflows/build-release.yml | |
create_release_zip: | |
name: Create and upload the zip asset to the release | |
runs-on: ubuntu-latest | |
needs: create_artifact | |
steps: | |
- name: Download built artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ github.event.repository.name }} | |
- name: Prepare the zip | |
run: | | |
cd ../ | |
zip -r ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip ${{ github.event.repository.name }} -x '*.git*' | |
mv ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip ./${{ github.event.repository.name }} | |
cd ./${{ github.event.repository.name }} | |
- name: Publish the zip on release | |
run: | | |
gh release upload ${{ github.event.release.tag_name }} ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip -R /${{ github.event.repository.full_name }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish_zip_to_marketplace: | |
name: Publish zip to the Marketplace | |
if: github.event.release.prerelease == false | |
runs-on: ubuntu-latest | |
needs: create_release_zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download release asset | |
run: | | |
gh release download ${{ github.event.release.tag_name }} -R ${{ github.event.repository.full_name }} -p ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_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@v4 | |
- name: Sentry Release PHP | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT_PHP }} | |
with: | |
environment: production | |
version: ${{ github.ref }} |