-
Notifications
You must be signed in to change notification settings - Fork 6
440 lines (393 loc) · 17.4 KB
/
publish_releases.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
name: "App releases"
on:
push:
branches:
- "main"
release:
types:
- "published"
workflow_dispatch:
inputs:
track:
description: "Which track do you want to deploy to"
required: true
type: choice
options:
- 'Firebase Dev'
- 'Firebase Release'
default: 'Firebase Dev'
jobs:
firebase_alpha:
if: >
( github.ref == 'refs/heads/main' && github.event_name == 'push' ) ||
( github.event.inputs.track == 'Firebase Dev' && github.event_name == 'workflow_dispatch' )
name: "Publish to Firebase Dev"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
steps:
- name: Fetch Radixbot push commit token
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-alpha-1'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/push-pat-token"
parse_json: true
- uses: RDXWorks-actions/checkout@main
with:
token: ${{ env.GH_RADIXBOT_PUSH_COMMIT_PAT_TOKEN }}
- name: Dump context
uses: RDXWorks-actions/ghaction-dump-context@master
- name: Download Ruby (action)
uses: RDXWorks-actions/setup-ruby@master
with:
ruby-version: '3.1.2'
bundler-cache: true
- uses: RDXWorks-actions/setup-java@main
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Fetch Firebase App ID
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android'
step_name: 'push-app-id'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/firebase/secrets"
parse_json: true
- name: Decode Google Service account credentials
uses: RDXWorks-actions/base64-to-file@main
id: google_application_credentials
with:
fileName: "service_account.json"
encodedString: ${{ env.GH_GOOGLE_SERVICE_ACCOUNT_JSON_FILE_BASE64 }}
- name: Decode Firebase Crashlytics json
uses: timheuer/base64-to-file@48657ba25c726c2e3dcf02efa3639fff9b3d587e
id: crashlytics_credentials
with:
fileName: "google-services.json"
fileDir: "app/"
encodedString: ${{ env.GH_CRASHLYTICS_GOOGLE_SERVICES_JSON_FILE_BASE64 }}
- name: Fetch GPR credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'firebase-dev'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/gpr-credentials"
parse_json: true
- name: Distribute Alpha to Firebase
run: |
git config user.name $GIT_USER
git config user.email $GIT_USER
bundle exec fastlane deployFirebaseAlpha
echo "### Distributed to Firebase Dev! :rocket:" >> $GITHUB_STEP_SUMMARY
env:
FIREBASE_APP_ID: ${{ env.GH_FIREBASE_DEV_APP_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.google_application_credentials.outputs.filePath }}
GROUPS: "alpha-devs"
GIT_USER: ${{ env.GH_GPR_USER }}
GPR_USER: ${{ env.GH_GPR_USER }}
GPR_TOKEN: ${{ env.GH_GPR_TOKEN }}
firebase_release:
if: >
( github.event_name == 'release' && github.event.release.prerelease == false ) ||
( github.event.inputs.track == 'Firebase Release' && github.event_name == 'workflow_dispatch' )
name: "Publish to Firebase Release"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
steps:
- name: Fetch Radixbot push commit token
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-release-1'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/push-pat-token"
parse_json: true
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
token: ${{ env.GH_RADIXBOT_PUSH_COMMIT_PAT_TOKEN }}
- name: Dump context
uses: RDXWorks-actions/ghaction-dump-context@master
- name: Download Ruby (action)
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42
with:
ruby-version: '3.1.2'
bundler-cache: true
- uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Fetch Firebase Release App ID
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android'
step_name: 'fetch-app-id'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/firebase/secrets"
parse_json: true
- name: Decode Google Service account credentials
uses: RDXWorks-actions/base64-to-file@main
id: google_application_credentials
with:
fileName: "service_account.json"
encodedString: ${{ env.GH_GOOGLE_SERVICE_ACCOUNT_JSON_FILE_BASE64 }}
- name: Fetch GPR credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'firebase-release'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/gpr-credentials"
parse_json: true
- name: Fetch Keystore credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android'
step_name: 'snyk-keystore'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/google-play-console/secrets"
parse_json: true
- name: Fetch keystore.asc value
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android-sa'
step_name: 'snyk-keystore-asc'
secret_prefix: 'GH_KEYSTORE_ENCRYPTED_BASE64'
secret_name: "github-actions/radixdlt/babylon-wallet-android/google-play-console/keystore-asc"
parse_json: false
- name: Decode release keystore credentials
shell: bash
run: |
mkdir config/signing/release
echo "${{ env.GH_KEYSTORE_ENCRYPTED_BASE64 }}" > keystore.asc
gpg -d --passphrase "${{ env.GH_KEYSTORE_PASSPHRASE }}" --batch keystore.asc > config/signing/release/keystore.jks
echo "keyAlias=${{ env.GH_KEYSTORE_ALIAS }}" > config/signing/release/keystore.properties
echo "keyPassword=${{ env.GH_KEYSTORE_KEY_PASSWORD }}" >> config/signing/release/keystore.properties
echo "storeFile=../config/signing/release/keystore.jks" >> config/signing/release/keystore.properties
echo "storePassword=${{ env.GH_KEYSTORE_PASSWORD }}" >> config/signing/release/keystore.properties
- name: Distribute Release to Firebase
run: |
git config user.name $GIT_USER
git config user.email $GIT_USER
bundle exec fastlane deployFirebaseRelease
echo "### Distributed to Firebase Release! :rocket:" >> $GITHUB_STEP_SUMMARY
env:
FIREBASE_APP_ID: ${{ env.GH_FIREBASE_RELEASE_APP_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.google_application_credentials.outputs.filePath }}
GROUPS: "alpha-devs"
GIT_USER: ${{ env.GH_GPR_USER }}
GPR_USER: ${{ env.GH_GPR_USER }}
GPR_TOKEN: ${{ env.GH_GPR_TOKEN }}
google_play_alpha_release:
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }}
name: "Publish Google Play Alpha"
runs-on: ubuntu-latest
environment: pre-release
permissions:
id-token: write
contents: read
pull-requests: read
steps:
- name: Fetch Radixbot push commit token
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-alpha-1'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/push-pat-token"
parse_json: true
- uses: RDXWorks-actions/checkout@main
with:
token: ${{ env.GH_RADIXBOT_PUSH_COMMIT_PAT_TOKEN }}
- name: Fetch GPR credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-alpha'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/gpr-credentials"
parse_json: true
- name: Fetch Crashlytics info
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gplay-crash'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/crashlytics"
parse_json: true
- name: Decode Firebase Crashlytics json
uses: timheuer/base64-to-file@48657ba25c726c2e3dcf02efa3639fff9b3d587e
id: crashlytics_credentials
with:
fileName: "google-services.json"
fileDir: "app/"
encodedString: ${{ env.GH_CRASHLYTICS_GOOGLE_SERVICES_JSON_FILE_BASE64 }}
- uses: ./.github/actions/google-play-common
with:
gpc_track: "alpha"
secret_arn: "arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/radixdlt/babylon-wallet-android/google-play-console/secrets-OEmdRj"
radix_bot_username: ${{ env.GH_GPR_USER }}
gpr_user: ${{ env.GH_GPR_USER }}
gpr_token: ${{ env.GH_GPR_TOKEN }}
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
google_play_production_release:
if: ${{ github.event_name == 'release' && github.event.release.prerelease == false }}
name: "Publish Google Play Production"
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: read
pull-requests: read
steps:
- name: Fetch Radixbot push commit token
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-alpha-1'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/push-pat-token"
parse_json: true
- uses: RDXWorks-actions/checkout@main
with:
token: ${{ env.GH_RADIXBOT_PUSH_COMMIT_PAT_TOKEN }}
- name: Fetch GPR credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gpc-alpha'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/gpr-credentials"
parse_json: true
- name: Fetch Crashlytics info
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gplay-crash'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/crashlytics"
parse_json: true
- name: Decode Firebase Crashlytics json
uses: timheuer/base64-to-file@48657ba25c726c2e3dcf02efa3639fff9b3d587e
id: crashlytics_credentials
with:
fileName: "google-services.json"
fileDir: "app/"
encodedString: ${{ env.GH_CRASHLYTICS_GOOGLE_SERVICES_JSON_FILE_BASE64 }}
- uses: ./.github/actions/google-play-common
with:
gpc_track: "production"
secret_arn: "arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/radixdlt/babylon-wallet-android/google-play-console/secrets"
radix_bot_username: ${{ env.GH_GPR_USER }}
gpr_user: ${{ env.GH_GPR_USER }}
gpr_token: ${{ env.GH_GPR_TOKEN }}
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
publish_sbom:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
permissions:
id-token: write
contents: write
pull-requests: read
name: Publish SBOM
steps:
- uses: RDXWorks-actions/checkout@main
- name: Fetch Snyk credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.COMMON_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'snyk-sbom'
secret_prefix: 'SNYK'
secret_name: "github-actions/common/snyk-credentials"
parse_json: true
- name: Fetch Keystore credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android'
step_name: 'snyk-keystore'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/google-play-console/secrets"
parse_json: true
- name: Fetch Google service account credentials
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android-sa'
step_name: 'snyk-sa'
secret_prefix: 'GH_GOOGLE_SERVICE_ACCOUNT_JSON_FILE'
secret_name: "github-actions/radixdlt/babylon-wallet-android/google-play-console/service-account-json-file"
parse_json: false
- name: Fetch keystore.asc value
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'babylon-wallet-android-sa'
step_name: 'snyk-keystore-asc'
secret_prefix: 'GH_KEYSTORE_ENCRYPTED_BASE64'
secret_name: "github-actions/radixdlt/babylon-wallet-android/google-play-console/keystore-asc"
parse_json: false
- name: Fetch Crashlytics info
uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: '${{ secrets.ANDROID_WALLET_SECRETS_READ_IAM_ROLE }}'
app_name: 'wallet-android'
step_name: 'gplay-crash'
secret_prefix: 'GH'
secret_name: "github-actions/radixdlt/babylon-wallet-android/crashlytics"
parse_json: true
- name: Decode Firebase Crashlytics json
uses: timheuer/base64-to-file@48657ba25c726c2e3dcf02efa3639fff9b3d587e
id: crashlytics_credentials
with:
fileName: "google-services.json"
fileDir: "app/"
encodedString: ${{ env.GH_CRASHLYTICS_GOOGLE_SERVICES_JSON_FILE_BASE64 }}
- name: Decode release keystore credentials
shell: bash
run: |
mkdir config/signing/release
echo "${{ env.GH_KEYSTORE_ENCRYPTED_BASE64 }}" > keystore.asc
gpg -d --passphrase "${{ env.GH_KEYSTORE_PASSPHRASE }}" --batch keystore.asc > config/signing/release/keystore.jks
echo "keyAlias=${{ env.GH_KEYSTORE_ALIAS }}" > config/signing/release/keystore.properties
echo "keyPassword=${{ env.GH_KEYSTORE_KEY_PASSWORD }}" >> config/signing/release/keystore.properties
echo "storeFile=../config/signing/release/keystore.jks" >> config/signing/release/keystore.properties
echo "storePassword=${{ env.GH_KEYSTORE_PASSWORD }}" >> config/signing/release/keystore.properties
- name: Generate SBOM
uses: RDXWorks-actions/snyk-actions/gradle-jdk17@master
with:
args: --all-projects --org=${{ env.SNYK_COREAPPS_ORG_ID }} --format=cyclonedx1.4+json --json-file-output sbom.json
command: sbom
env:
SNYK_TOKEN: ${{ env.SNYK_TOKEN }}
RADIX_DEBUG_PREVIEW_KEYSTORE_FILE: config/signing/release/keystore.jks
- name: Upload SBOM
uses: RDXWorks-actions/upload-release-action@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sbom.json
tag: ${{ github.ref }}
overwrite: true