-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitrise.yml
312 lines (312 loc) · 8.7 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
---
format_version: '8'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: react-native
trigger_map:
# - push_branch: 'develop'
# workflow: start_release_builds
# - push_branch: 'main'
# workflow: start_release_builds
- pull_request_source_branch: '*'
workflow: ci_test
workflows:
# Code Setups
setup:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@4: {}
code_setup_cache:
before_run:
- setup
steps:
- cache-pull@2: {}
- nvm@1:
inputs:
- node_version: '14'
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: install --network-timeout 300000 --frozen-lockfile --network-concurrency 1
title: Yarn Install
- 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:
- nvm@1:
inputs:
- node_version: '14'
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: install --network-timeout 300000 --frozen-lockfile --network-concurrency 1
title: Yarn Install
- 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:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
curl -sL https://sentry.io/get-cli/
title: Install Test Dependencies (Sentry)
is_always_run: false
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: global add detox-cli
title: Install Detox CLI
android_e2e_test:
before_run:
- code_setup
- e2e_setup
steps:
- install-missing-android-tools@2:
inputs:
- gradlew_path: $PROJECT_LOCATION/gradlew
- avd-manager@1:
inputs:
- api_level: '29'
- profile: pixel
- wait-for-android-emulator@1: {}
- 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_cache
- e2e_setup
steps:
- 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
- yarn@0:
inputs:
- cache_local_deps: 'yes'
- command: test:e2e:ios
title: E2E Tests on iOS
is_always_run: false
start_e2e_tests:
steps:
- build-router-start@0:
inputs:
- workflows: |-
android_e2e_test
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
start_release_builds:
steps:
- build-router-start@0:
inputs:
- workflows: |-
android_test_release_step
ios_test_release_step
- 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-release.apk
title: Bitrise Deploy APK
- yarn@0:
inputs:
- command: build:announce
title: Accouncing pre-release
is_always_run: false
android_test_release_step:
before_run:
- code_setup
steps:
- change-android-versioncode-and-versionname@1:
inputs:
- new_version_name: $VERSION_NAME
- 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:
- gradlew_path: $PROJECT_LOCATION/gradlew
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
jq 'del(.engines)' package.json > new.json && mv new.json package.json
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/release/app-release.apk
title: Bitrise Deploy APK
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/apk/release/sha512sums.txt
title: Bitrise Deploy Checksum
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: $PROJECT_LOCATION/app/build/outputs/bundle/release/app-release.aab
title: Bitrise Deploy AAB
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/android/index.js.map
title: Bitrise Deploy Sourcemaps
- google-play-deploy@3:
inputs:
- app_path: $PROJECT_LOCATION/app/build/outputs/bundle/release/app-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
ios_test_release_step:
before_run:
- code_setup_cache
steps:
- certificate-and-profile-installer@1: {}
- set-xcode-build-number@1:
inputs:
- build_short_version_string: $VERSION_NAME
- plist_path: $PROJECT_LOCATION_IOS/BITG/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
curl -sL https://sentry.io/get-cli/ | bash
title: Install Sentry CLI
is_always_run: false
- cocoapods-install@2: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
jq 'del(.engines)' package.json > new.json && mv new.json package.json
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/BITG.ipa
title: Deploy iOS IPA
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: ios/build/BITG.xcarchive
title: Deploy Symbols File
- deploy-to-bitrise-io@1:
inputs:
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
- deploy-to-itunesconnect-application-loader@1:
inputs:
- ipa_path: ios/build/output/BITG.ipa
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: android
- opts:
is_expand: false
MODULE: app
- opts:
is_expand: false
VARIANT: ''
- opts:
is_expand: false
BITRISE_PROJECT_PATH: ios/BITG.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: BITG
- 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: 2.4.0
- opts:
is_expand: false
ANDROID_APK_LINK: ''
- opts:
is_expand: false
ANDROID_AAP_LINK: ''
- opts:
is_expand: false
IOS_APP_LINK: ''