forked from MetaMask/metamask-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
451 lines (434 loc) · 13.6 KB
/
bitrise.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
441
442
443
444
445
446
447
448
449
450
451
---
format_version: '8'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: react-native
workflows:
# Code Setups
setup:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
inputs:
- node_version: '14'
code_setup_cache:
before_run:
- setup
steps:
- cache-pull@2: {}
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: setup
title: Yarn Setup
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: audit:ci
title: Audit Dependencies
- yarn@0:
title: Lint
inputs:
- cache_local_deps: 'yes'
- command: lint
is_always_run: true
- cache-push@2: {}
code_setup:
before_run:
- setup
steps:
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: setup
title: Yarn Setup
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: audit:ci
title: Audit Dependencies
- yarn@0:
title: Lint
inputs:
- cache_local_deps: 'yes'
- command: lint
is_always_run: true
# CI Steps
ci_test:
before_run:
- code_setup_cache
steps:
- yarn@0:
inputs:
- args: ''
- command: test:unit --silent
title: Unit Test
is_always_run: false
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
echo 'weew - everything passed!'
title: All Tests Passed
is_always_run: false
# E2E Steps
e2e_setup:
steps:
- yarn@:
inputs:
- cache_local_deps: 'yes'
- command: global add detox-cli
title: Detox - Install CLI
android_e2e_test:
before_run:
- code_setup
- e2e_setup
steps:
- install-missing-android-tools@2:
inputs:
- ndk_revision: $NDK_VERSION
- gradlew_path: $PROJECT_LOCATION/gradlew
- avd-manager@1:
inputs:
- api_level: '29'
- create_command_flags: '--sdcard 4096M'
- profile: pixel
- wait-for-android-emulator@1: {}
- file-downloader@1:
inputs:
- source: $BITRISEIO_ANDROID_KEYSTORE_URL
- destination: android/keystores/release.keystore
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: test:e2e:android
title: E2E Tests on Android
is_always_run: false
ios_e2e_test:
before_run:
- code_setup
- e2e_setup
steps:
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/Info.plist
- script:
inputs:
- content: |-
# Add cache directory to environment variable
envman add --key BREW_APPLESIMUTILS --value "$(brew --cellar)/applesimutils"
envman add --key BREW_OPT_APPLESIMUTILS --value "/usr/local/opt/applesimutils"
brew tap wix/brew
title: Set Env Path for caching deps
- cocoapods-install@2:
is_always_run: false
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
node -v
METAMASK_ENVIRONMENT='production' yarn test:e2e:ios
title: Detox Build & Test
is_always_run: false
start_e2e_tests:
steps:
- build-router-start@0:
inputs:
- workflows: |-
ios_e2e_test
- wait_for_builds: 'true'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- build-router-wait@0:
inputs:
- abort_on_fail: 'yes'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash echo 'weew - everything passed!'
title: All Tests Passed
is_always_run: false
# Parallel Build & Deploy Steps
create_release_builds:
before_run:
- code_setup_cache
steps:
- build-router-start@0:
inputs:
- workflows: |-
build_android_release
build_ios_release
- wait_for_builds: 'true'
- abort_on_fail: 'yes'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- build-router-wait@0:
inputs:
- abort_on_fail: 'yes'
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
release_to_stores:
before_run:
- code_setup_cache
steps:
- build-router-start@0:
inputs:
- workflows: |-
deploy_android_to_store
deploy_ios_to_store
- wait_for_builds: 'true'
- abort_on_fail: 'yes'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- build-router-wait@0:
inputs:
- abort_on_fail: 'yes'
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $BITRISE_DEPLOY_DIR/app-prod-release.apk
title: Bitrise Deploy APK
- yarn@0:
inputs:
- command: build:announce
title: Accouncing pre-release
is_always_run: false
create_qa_builds:
before_run:
- code_setup_cache
steps:
- build-router-start@0:
inputs:
- workflows: |-
build_android_qa
build_ios_qa
- wait_for_builds: 'true'
- abort_on_fail: 'yes'
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
- build-router-wait@0:
inputs:
- abort_on_fail: 'yes'
- build_artifacts_save_path: $BITRISE_DEPLOY_DIR
- access_token: $BITRISE_START_BUILD_ACCESS_TOKEN
build_android_release:
before_run:
- code_setup
steps:
- change-android-versioncode-and-versionname@1:
inputs:
- new_version_name: $VERSION_NAME
- new_version_code: $VERSION_NUMBER
- build_gradle_path: $PROJECT_LOCATION_ANDROID/app/build.gradle
- file-downloader@1:
inputs:
- source: $BITRISEIO_ANDROID_KEYSTORE_URL
- destination: android/keystores/release.keystore
- install-missing-android-tools@2:
inputs:
- ndk_revision: $NDK_VERSION
- gradlew_path: $PROJECT_LOCATION/gradlew
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
node -v
METAMASK_ENVIRONMENT='production' yarn build:android:pre-release:bundle
title: Build Android Pre-Release Bundle
is_always_run: false
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/prod/release/app-prod-release.apk
title: Bitrise Deploy APK
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/prod/release/sha512sums.txt
title: Bitrise Deploy Checksum
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/mapping/prodRelease/mapping.txt
title: Bitrise ProGuard Map Files
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/prodRelease/app-prod-release.aab
title: Bitrise Deploy AAB
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/android/index.js.map
title: Bitrise Deploy Sourcemaps
build_android_qa:
before_run:
- code_setup
steps:
- change-android-versioncode-and-versionname@1:
inputs:
- new_version_name: $VERSION_NAME
- new_version_code: $VERSION_NUMBER
- build_gradle_path: $PROJECT_LOCATION_ANDROID/app/build.gradle
- file-downloader@1:
inputs:
- source: $BITRISEIO_ANDROID_QA_KEYSTORE_URL
- destination: android/keystores/internalRelease.keystore
- install-missing-android-tools@2:
inputs:
- ndk_revision: $NDK_VERSION
- gradlew_path: $PROJECT_LOCATION/gradlew
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
node -v
GIT_BRANCH=$BITRISE_GIT_BRANCH METAMASK_ENVIRONMENT='qa' yarn build:android:pre-release:bundle:qa
title: Build Android Pre-Release Bundle
is_always_run: false
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/qa/release/app-qa-release.apk
title: Bitrise Deploy APK
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/qa/release/sha512sums.txt
title: Bitrise Deploy Checksum
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/mapping/qaRelease/mapping.txt
title: Bitrise ProGuard Map Files
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/qaRelease/app-qa-release.aab
title: Bitrise Deploy AAB
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/android/index.js.map
title: Bitrise Deploy Sourcemaps
deploy_android_to_store:
before_run:
- build_android_release
steps:
- google-play-deploy:
inputs:
- app_path: $PROJECT_LOCATION/app/build/outputs/bundle/prodRelease/app-prod-release.aab
- track: internal
- service_account_json_key_path: $BITRISEIO_BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL_URL
- package_name: $MM_ANDROID_PACKAGE_NAME
envs:
- opts:
is_expand: false
MM_ANDROID_PACKAGE_NAME: io.metamask
deploy_ios_to_store:
before_run:
- build_ios_release
steps:
- deploy-to-itunesconnect-application-loader@1:
inputs:
- ipa_path: ios/build/output/MetaMask.ipa
build_ios_release:
before_run:
- code_setup_cache
steps:
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- build_version: $VERSION_NUMBER
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/Info.plist
- cocoapods-install@2: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
node -v
METAMASK_ENVIRONMENT='production' yarn build:ios:pre-release
title: iOS Sourcemaps & Build
is_always_run: false
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: ios/build/output/MetaMask.ipa
title: Deploy iOS IPA
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: ios/build/MetaMask.xcarchive
title: Deploy Symbols File
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
build_ios_qa:
before_run:
- code_setup_cache
steps:
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- build_version: $VERSION_NUMBER
- plist_path: $PROJECT_LOCATION_IOS/MetaMask/MetaMask-QA-Info.plist
- cocoapods-install@2: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
node -v
GIT_BRANCH=$BITRISE_GIT_BRANCH METAMASK_ENVIRONMENT='qa' yarn build:ios:pre-qa
title: iOS Sourcemaps & Build
is_always_run: false
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: ios/build/output/MetaMask-QA.ipa
title: Deploy iOS IPA
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: ios/build/MetaMask-QA.xcarchive
title: Deploy Symbols File
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: android
- opts:
is_expand: false
NDK_VERSION: 21e
- opts:
is_expand: false
MODULE: app
- opts:
is_expand: false
VARIANT: ''
- opts:
is_expand: false
BITRISE_PROJECT_PATH: ios/MetaMask.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: MetaMask
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: enterprise
- opts:
is_expand: false
PROJECT_LOCATION_ANDROID: android
- opts:
is_expand: false
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
VERSION_NAME: 5.8.0
- opts:
is_expand: false
VERSION_NUMBER: 973
- opts:
is_expand: false
ANDROID_APK_LINK: ''
- opts:
is_expand: false
ANDROID_AAP_LINK: ''
- opts:
is_expand: false
IOS_APP_LINK: ''
meta:
bitrise.io:
stack: osx-xcode-13.4.x