-
Notifications
You must be signed in to change notification settings - Fork 109
306 lines (272 loc) · 11.5 KB
/
release-wallet.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
name: Deploy interface and release extension
on:
workflow_dispatch:
inputs:
REF:
required: true
type: string
default: "main"
REACT_APP_NAMADA_ALIAS:
required: true
type: string
default: "Namada Testnet"
REACT_APP_NAMADA_CHAIN_ID:
required: true
type: string
REACT_APP_NAMADA_URL:
required: true
type: string
REACT_APP_COSMOS_ALIAS:
required: false
type: string
default: "Cosmos Testnet"
REACT_APP_COSMOS_CHAIN_ID:
required: false
type: string
REACT_APP_COSMOS_URL:
required: false
type: string
REACT_APP_ETH_ALIAS:
required: false
type: string
default: "Goerli Testnet"
REACT_APP_ETH_CHAIN_ID:
required: false
type: string
REACT_APP_ETH_URL:
required: false
type: string
env:
CI: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.set-environment-variables.outputs.VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.REF }}
- name: Set environment variables
id: set-environment-variables
run: |
COMMIT_HASH=$(git rev-parse --short $SHA)
BASE_VERSION=$(node -e 'console.log(require("./package.json").version)')
echo "VERSION=v$BASE_VERSION-$COMMIT_HASH" >> "$GITHUB_OUTPUT"
env:
SHA: ${{ github.sha }}
- name: Print workflow inputs
run: |
echo "REACT_APP_NAMADA_ALIAS: $REACT_APP_NAMADA_ALIAS" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_NAMADA_CHAIN_ID: $REACT_APP_NAMADA_CHAIN_ID" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_NAMADA_URL: $REACT_APP_NAMADA_URL" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_COSMOS_ALIAS: $REACT_APP_COSMOS_ALIAS" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_COSMOS_CHAIN_ID: $REACT_APP_COSMOS_CHAIN_ID" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_COSMOS_URL: $REACT_APP_COSMOS_URL" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_ETH_ALIAS: $REACT_APP_ETH_ALIAS" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_ETH_CHAIN_ID: $REACT_APP_ETH_CHAIN_ID" >> $GITHUB_STEP_SUMMARY
echo "REACT_APP_ETH_URL: $REACT_APP_ETH_URL" >> $GITHUB_STEP_SUMMARY
env:
REACT_APP_NAMADA_ALIAS: ${{ inputs.REACT_APP_NAMADA_ALIAS }}
REACT_APP_NAMADA_CHAIN_ID: ${{ inputs.REACT_APP_NAMADA_CHAIN_ID }}
REACT_APP_NAMADA_URL: ${{ inputs.REACT_APP_NAMADA_URL }}
REACT_APP_COSMOS_ALIAS: ${{ inputs.REACT_APP_COSMOS_ALIAS }}
REACT_APP_COSMOS_CHAIN_ID: ${{ inputs.REACT_APP_COSMOS_CHAIN_ID }}
REACT_APP_COSMOS_URL: ${{ inputs.REACT_APP_COSMOS_URL }}
REACT_APP_ETH_ALIAS: ${{ inputs.REACT_APP_ETH_ALIAS }}
REACT_APP_ETH_CHAIN_ID: ${{ inputs.REACT_APP_ETH_CHAIN_ID }}
REACT_APP_ETH_URL: ${{ inputs.REACT_APP_ETH_URL }}
build-interface:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.REF }}
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: build
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Build the interface
working-directory: ./apps/namada-interface
run: yarn build
env:
REACT_APP_NAMADA_ALIAS: ${{ inputs.REACT_APP_NAMADA_ALIAS }}
REACT_APP_NAMADA_CHAIN_ID: ${{ inputs.REACT_APP_NAMADA_CHAIN_ID }}
REACT_APP_NAMADA_URL: ${{ inputs.REACT_APP_NAMADA_URL }}
REACT_APP_COSMOS_ALIAS: ${{ inputs.REACT_APP_COSMOS_ALIAS }}
REACT_APP_COSMOS_CHAIN_ID: ${{ inputs.REACT_APP_COSMOS_CHAIN_ID }}
REACT_APP_COSMOS_URL: ${{ inputs.REACT_APP_COSMOS_URL }}
REACT_APP_ETH_ALIAS: ${{ inputs.REACT_APP_ETH_ALIAS }}
REACT_APP_ETH_CHAIN_ID: ${{ inputs.REACT_APP_ETH_CHAIN_ID }}
REACT_APP_ETH_URL: ${{ inputs.REACT_APP_ETH_URL }}
REACT_APP_EXTENSION_URL: https://github.com/anoma/namada-interface/releases/tag/${{ needs.setup.outputs.VERSION }}/
- uses: actions/upload-artifact@v3
with:
name: namada-interface
path: ./apps/namada-interface/build
build-extension-chrome:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.REF }}
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: build
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install web-ext
run: yarn dlx node-gyp && yarn dlx web-ext
- name: Build WASM dependencies
working-directory: ./apps/extension
run: yarn wasm:build
- name: Build the extension
working-directory: ./apps/extension
run: yarn build:chrome
env:
REACT_APP_NAMADA_ALIAS: ${{ inputs.REACT_APP_NAMADA_ALIAS }}
REACT_APP_NAMADA_CHAIN_ID: ${{ inputs.REACT_APP_NAMADA_CHAIN_ID }}
REACT_APP_NAMADA_URL: ${{ inputs.REACT_APP_NAMADA_URL }}
REACT_APP_COSMOS_ALIAS: ${{ inputs.REACT_APP_COSMOS_ALIAS }}
REACT_APP_COSMOS_CHAIN_ID: ${{ inputs.REACT_APP_COSMOS_CHAIN_ID }}
REACT_APP_COSMOS_URL: ${{ inputs.REACT_APP_COSMOS_URL }}
REACT_APP_ETH_ALIAS: ${{ inputs.REACT_APP_ETH_ALIAS }}
REACT_APP_ETH_CHAIN_ID: ${{ inputs.REACT_APP_ETH_CHAIN_ID }}
REACT_APP_ETH_URL: ${{ inputs.REACT_APP_ETH_URL }}
- uses: actions/upload-artifact@v3
with:
name: namada-extension-chrome
path: ./apps/extension/build/chrome/namada_extension-*.zip
build-extension-firefox:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.REF }}
- name: Install yarn dependencies
uses: ./.github/actions/yarn-cache
- name: Restore Rust cache
uses: ./.github/actions/rust-cache
with:
cache-name: build
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install web-ext
run: yarn dlx add node-gyp && yarn dlx add web-ext
- name: Build WASM dependencies
working-directory: ./apps/extension
run: yarn wasm:build
- name: Build the extension
working-directory: ./apps/extension
run: yarn build:firefox
env:
REACT_APP_NAMADA_ALIAS: ${{ inputs.REACT_APP_NAMADA_ALIAS }}
REACT_APP_NAMADA_CHAIN_ID: ${{ inputs.REACT_APP_NAMADA_CHAIN_ID }}
REACT_APP_NAMADA_URL: ${{ inputs.REACT_APP_NAMADA_URL }}
REACT_APP_COSMOS_ALIAS: ${{ inputs.REACT_APP_COSMOS_ALIAS }}
REACT_APP_COSMOS_CHAIN_ID: ${{ inputs.REACT_APP_COSMOS_CHAIN_ID }}
REACT_APP_COSMOS_URL: ${{ inputs.REACT_APP_COSMOS_URL }}
REACT_APP_ETH_ALIAS: ${{ inputs.REACT_APP_ETH_ALIAS }}
REACT_APP_ETH_CHAIN_ID: ${{ inputs.REACT_APP_ETH_CHAIN_ID }}
REACT_APP_ETH_URL: ${{ inputs.REACT_APP_ETH_URL }}
- uses: actions/upload-artifact@v3
with:
name: namada-extension-firefox
path: ./apps/extension/build/firefox/namada_extension-*.zip
release:
needs:
[setup, build-interface, build-extension-chrome, build-extension-firefox]
runs-on: ubuntu-latest
steps:
- name: Download interface build
uses: actions/download-artifact@v3
with:
name: namada-interface
path: ./namada-interface
- name: Download Chrome extension build
uses: actions/download-artifact@v3
with:
name: namada-extension-chrome
path: ./namada-extension-chrome
- name: Download Firefox extension build
uses: actions/download-artifact@v3
with:
name: namada-extension-firefox
path: ./namada-extension-firefox
- name: Get extension filenames
id: get-filenames
run: |
echo "CHROME_FILENAME=$(ls -1 ./namada-extension-chrome)" >> "$GITHUB_OUTPUT"
echo "FIREFOX_FILENAME=$(ls -1 ./namada-extension-firefox)" >> "$GITHUB_OUTPUT"
- name: Deploy interface to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: ./namada-interface
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deployed release ${{ needs.setup.outputs.VERSION }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN_WALLET_PREVIEW }}
NETLIFY_SITE_ID: 2380782e-9b20-477a-bc27-b4e9d05e16f3
- name: Make release body text
run: |
echo "REACT_APP_NAMADA_ALIAS: $REACT_APP_NAMADA_ALIAS" >> RELEASE
echo "REACT_APP_NAMADA_CHAIN_ID: $REACT_APP_NAMADA_CHAIN_ID" >> RELEASE
echo "REACT_APP_NAMADA_URL: $REACT_APP_NAMADA_URL" >> RELEASE
echo "REACT_APP_COSMOS_ALIAS: $REACT_APP_COSMOS_ALIAS" >> RELEASE
echo "REACT_APP_COSMOS_CHAIN_ID: $REACT_APP_COSMOS_CHAIN_ID" >> RELEASE
echo "REACT_APP_COSMOS_URL: $REACT_APP_COSMOS_URL" >> RELEASE
echo "REACT_APP_ETH_ALIAS: $REACT_APP_ETH_ALIAS" >> RELEASE
echo "REACT_APP_ETH_CHAIN_ID: $REACT_APP_ETH_CHAIN_ID" >> RELEASE
echo "REACT_APP_ETH_URL: $REACT_APP_ETH_URL" >> RELEASE
env:
REACT_APP_NAMADA_ALIAS: ${{ inputs.REACT_APP_NAMADA_ALIAS }}
REACT_APP_NAMADA_CHAIN_ID: ${{ inputs.REACT_APP_NAMADA_CHAIN_ID }}
REACT_APP_NAMADA_URL: ${{ inputs.REACT_APP_NAMADA_URL }}
REACT_APP_COSMOS_ALIAS: ${{ inputs.REACT_APP_COSMOS_ALIAS }}
REACT_APP_COSMOS_CHAIN_ID: ${{ inputs.REACT_APP_COSMOS_CHAIN_ID }}
REACT_APP_COSMOS_URL: ${{ inputs.REACT_APP_COSMOS_URL }}
REACT_APP_ETH_ALIAS: ${{ inputs.REACT_APP_ETH_ALIAS }}
REACT_APP_ETH_CHAIN_ID: ${{ inputs.REACT_APP_ETH_CHAIN_ID }}
REACT_APP_ETH_URL: ${{ inputs.REACT_APP_ETH_URL }}
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_name: ${{ needs.setup.outputs.VERSION }}
tag_name: ${{ needs.setup.outputs.VERSION }}
body_path: ./RELEASE
- name: Add Chrome extension to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./namada-extension-chrome/${{ steps.get-filenames.outputs.CHROME_FILENAME }}
asset_name: namada-extension-chrome_${{ needs.setup.outputs.VERSION }}.zip
asset_content_type: application/zip
- name: Add Firefox extension to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./namada-extension-firefox/${{ steps.get-filenames.outputs.FIREFOX_FILENAME }}
asset_name: namada-extension-firefox_${{ needs.setup.outputs.VERSION }}.zip
asset_content_type: application/zip