-
Notifications
You must be signed in to change notification settings - Fork 12
142 lines (123 loc) · 5.03 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Publish
on:
release:
types: [published]
jobs:
build:
name: build dependencies & create artifact
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm
cache-dependency-path: '_dev/package-lock.json'
- name: Install & build
working-directory: _dev
run: |
npm install
npm run build
- name: Install composer dependencies
run: composer install --no-dev -o
- name: Clean-up project
uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0
- name: Create & upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}
path: ../
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@v2
with:
name: ${{ github.event.repository.name }}
- name: Prepare the production zip
run: |
cd ${{ github.event.repository.name }}
zip -r ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip ${{ github.event.repository.name }} -x '*.git*'
- name: Publish the production zip
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ github.event.repository.name }}/${{ 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@v2
with:
name: ${{ github.event.repository.name }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
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="google-shopping-module" > psxmarketingwithgoogle/psxmarketingwithgoogle/.env
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.G_CREDENTIAL_INTEGRATION }}
- name: Prepare the integration zip
run: |
cd ${{ github.event.repository.name }}
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: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ github.event.repository.name }}/${{ 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@v2
- name: Download release asset
uses: dsaltares/fetch-gh-release-asset@0.0.5
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:
runs-on: ubuntu-latest
if: github.event.release.prerelease == false
steps:
- uses: actions/checkout@v2
- name: Sentry Release
uses: getsentry/action-release@v1.0.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
version: ${{ github.ref }}