-
Notifications
You must be signed in to change notification settings - Fork 146
161 lines (139 loc) · 5.27 KB
/
publish-extensions.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Publish extensions
on:
push:
tags-ignore:
- 'v*beta*'
workflow_dispatch:
env:
COINBASE_APP_ID: ${{ secrets.COINBASE_APP_ID }}
MOONPAY_API_KEY: ${{ secrets.MOONPAY_API_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
BESTINSLOT_API_KEY: ${{ secrets.BESTINSLOT_API_KEY }}
BITFLOW_API_HOST: ${{ secrets.BITFLOW_API_HOST }}
BITFLOW_API_KEY: ${{ secrets.BITFLOW_API_KEY }}
BITFLOW_STACKS_API_HOST: ${{ secrets.BITFLOW_STACKS_API_HOST }}
BITFLOW_READONLY_CALL_API_HOST: ${{ secrets.BITFLOW_READONLY_CALL_API_HOST }}
WALLET_ENVIRONMENT: production
IS_PUBLISHING: true
jobs:
extract-version:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Extract version
id: extract_version
uses: Saionaro/[email protected]
- name: Print version
run: echo ${{ steps.extract_version.outputs.version }}
publish-chrome-extension:
name: Publish Chrome extension
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- extract-version
outputs:
publish_status: ${{ steps.publish-chrome.outputs.publish_status }}
env:
TARGET_BROWSER: chromium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- name: Build project
env:
# We only add the sentry auth token for chrome, as we don't want to
# create a duplicate release during the ff build
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm build
- uses: actions/upload-artifact@v3
name: Upload build artifact
with:
name: leather-chromium-v${{ needs.extract-version.outputs.new_version }}
path: dist
- name: Build extension
run: sh build-ext.sh
- name: Sign and Upload Production Chrome extension
continue-on-error: true
id: publish-chrome
run: |
pnpm chrome-webstore-upload upload --auto-publish --source leather-chromium.zip
echo "::set-output name=publish_status::${?}"
env:
EXTENSION_ID: ${{ secrets.CHROME_APP_ID }}
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish-firefox-extension:
name: Publish Firefox extension
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
env:
TARGET_BROWSER: firefox
needs:
- extract-version
outputs:
publish_status: ${{ steps.publish-firefox.outputs.publish_status }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- name: Build project
run: pnpm build
- uses: actions/upload-artifact@v3
name: Upload build artifact
with:
name: leather-firefox-v${{ needs.extract-version.outputs.new_version }}
path: dist
- name: Sign and Upload Production Firefox extension
continue-on-error: true
id: publish-firefox
run: |
pnpm web-ext-submit --channel listed --artifacts-dir dist
echo "::set-output name=publish_status::${?}"
env:
WEB_EXT_API_KEY: ${{ secrets.FIREFOX_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.FIREFOX_API_SECRET }}
create-github-release:
name: Create Github release
runs-on: ubuntu-latest
needs:
- extract-version
- publish-chrome-extension
- publish-firefox-extension
steps:
- name: Download extension build
uses: actions/download-artifact@v3
with:
path: .
- name: Download release-notes.txt from create-version workflow
uses: dawidd6/action-download-artifact@v6
with:
workflow: create-version.yml
name: release-notes
allow_forks: false
- name: Zip Firefox build
run: zip -r leather-firefox.v${{ needs.extract-version.outputs.new_version }}.zip leather-firefox-v${{ needs.extract-version.outputs.new_version }}
- name: Zip Chromium build
run: zip -r leather-chromium.v${{ needs.extract-version.outputs.new_version }}.zip leather-chromium-v${{ needs.extract-version.outputs.new_version }}
- run: ls -la .
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v${{ needs.extract-version.outputs.new_version }}
body_path: release-notes.txt
files: |
leather-chromium.v${{ needs.extract-version.outputs.new_version }}.zip
leather-firefox.v${{ needs.extract-version.outputs.new_version }}.zip
post_run:
runs-on: ubuntu-latest
needs:
- publish-chrome-extension
- publish-firefox-extension
steps:
- name: Publish Statuses
run: |
echo "::warning::Firefox Publish Status: $([[ "${{ needs.publish-firefox-extension.outputs.publish_status }}" = "0" ]] && echo 'SUCCESS' || echo 'FAILED')"
echo "::warning::Chrome Publish Status: $([[ "${{ needs.publish-chrome-extension.outputs.publish_status }}" = "0" ]] && echo 'SUCCESS' || echo 'FAILED')"