-
Notifications
You must be signed in to change notification settings - Fork 119
71 lines (62 loc) · 2.58 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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 }}