forked from rainbow-me/rainbow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
295 lines (284 loc) Β· 10.5 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
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: develop
workflow: workflow_testflight
- pull_request_source_branch: '*'
workflow: workflow_tests
pull_request_target_branch: develop
workflows:
build_setup:
steps:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@4: {}
- cache-pull@2: {}
- nvm@1:
inputs:
- node_version: 12.18.3
inputs:
- cache_local_deps: 'yes'
- command: install --network-timeout 300000 --network-concurrency 1
title: Installing dependencies via yarn
- script@1:
title: Check for lockfile changes (Fake --frozen-lockfile)
inputs:
- content: |-
git diff yarn.lock
if ! git diff --exit-code yarn.lock; then
echo "Changes were detected in yarn.lock file after running 'yarn install', which is not expected. Please run 'yarn install' locally and commit the changes.";
exit 1;
fi
before_run:
after_run:
lint:
before_run: []
after_run: []
steps:
inputs:
- command: lint
title: Linting for Errors
detox_tests:
before_run: []
after_run: []
steps:
inputs:
- content: |-
#!/bin/bash
detox build --configuration ios.sim.release
title: Detox - Build Release App
inputs:
- content: |-
#!/bin/bash
detox test -R 1 --configuration ios.sim.release -l verbose
title: Detox - Run E2E Tests
detox_setup:
steps:
inputs:
- cache_local_deps: 'yes'
- command: global add detox-cli
title: Detox - Install CLI
- 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"
title: Detox- Set Env Path for caching deps
inputs:
- content: |-
#!/bin/bash
brew tap wix/brew
title: Detox - Setup
pods_setup:
steps:
inputs:
- podfile_path: './ios/Podfile'
workflow_testflight:
before_run:
- generate_dot_env_testflight
- build_setup
- pods_setup
steps:
- [email protected]: {}
inputs:
- work_dir: '$BITRISE_SOURCE_DIR/ios'
- lane: beta
title: Fastlane - Submit to Testflight
- xcode-project-info@2:
inputs:
- xcodeproj_path: ios/Rainbow.xcodeproj
- info_plist_path: ios/Rainbow/Info.plist
title: Expose build number to ENV vars
inputs:
- command: global add @sentry/cli
title: Install Sentry CLI
inputs:
- work_dir: '$BITRISE_SOURCE_DIR/ios'
- lane: refresh_dsyms
title: Fastlane - Upload debug symbols and sourcemaps
title: Expose version number to ENV vars
inputs:
- content: |+
#!/bin/bash
set -ex
# get the values
INFO_XCODE_PROJ=./ios/Rainbow.xcodeproj/project.pbxproj
version=$(cat "${INFO_XCODE_PROJ}" | grep "MARKETING_VERSION" | head -n 1 | sed 's/[^0-9\.]//g')
# expose the env vars for subsequent steps
envman add --key RAINBOW_VERSION --value "${version}"
- slack@3:
inputs:
- webhook_url: '$SLACK_WEBHOOK_URL'
- buttons: 'View Build|${BITRISE_BUILD_URL}'
- fields: |
App|${BITRISE_APP_TITLE}
Branch|${BITRISE_GIT_BRANCH}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Version|${RAINBOW_VERSION} (${XPI_BUILD})
- pretext: '*Build Submitted to Testflight!*'
- cache-push@2: {}
envs:
- opts:
is_expand: false
SENTRY_ENVIRONMENT: Release
- opts:
is_expand: false
IS_TESTING: 'false'
- opts:
is_expand: false
ENABLE_DEV_MODE: '0'
- opts:
is_expand: false
GANACHE_URL: http://127.0.0.1:7545
workflow_tests:
before_run:
- generate_dot_env_testing
- build_setup
- lint
- pods_setup
- detox_setup
- detox_tests
envs:
- opts:
is_expand: false
SENTRY_ENVIRONMENT: LocalRelease
- opts:
is_expand: false
IS_TESTING: 'true'
- opts:
is_expand: false
ENABLE_DEV_MODE: '1'
- opts:
is_expand: false
GANACHE_URL: http://127.0.0.1:7545
steps:
- slack@3:
inputs:
- channel: '#bitrise'
- from_username: Bitrise Bot
- pretext: '* All Tests Passed! *'
- channel_on_error: '#bitrise'
- text_on_error: Build failed
- emoji_on_error: ''
- from_username_on_error: Bitrise bot
- buttons: |
View Pull Request|${BITRISEIO_PULL_REQUEST_REPOSITORY_URL}
View Build|${BITRISE_BUILD_URL}
- webhook_url: '$SLACK_WEBHOOK_URL'
- cache-push@2:
inputs:
- cache_paths: |
$BITRISE_CACHE_DIR
# Add the following two to cache_path
$BREW_APPLESIMUTILS
$BREW_OPT_APPLESIMUTILS
generate_dot_env_testing:
steps:
inputs:
- content: |+
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
touch .env
echo "DATA_ORIGIN=$DATA_ORIGIN" >> .env
echo "INFURA_PROJECT_ID=$INFURA_PROJECT_ID" >> .env
echo "INFURA_PROJECT_ID_DEV=$INFURA_PROJECT_ID_DEV" >> .env
echo "REACT_APP_SEGMENT_API_WRITE_KEY=$REACT_APP_SEGMENT_API_WRITE_KEY" >> .env
echo "DATA_API_KEY=$DATA_API_KEY" >> .env
echo "DATA_ENDPOINT=$DATA_ENDPOINT" >> .env
echo "SENTRY_ENDPOINT=$SENTRY_ENDPOINT" >> .env
echo "SENTRY_ENVIRONMENT=$SENTRY_ENVIRONMENT" >> .env
echo "WYRE_ENDPOINT=$WYRE_ENDPOINT" >> .env
echo "WYRE_ACCOUNT_ID=$WYRE_ACCOUNT_ID" >> .env
echo "RAINBOW_WYRE_MERCHANT_ID=$RAINBOW_WYRE_MERCHANT_ID" >> .env
echo "WYRE_ENDPOINT_TEST=$WYRE_ENDPOINT_TEST" >> .env
echo "WYRE_ACCOUNT_ID_TEST=$WYRE_ACCOUNT_ID_TEST" >> .env
echo "RAINBOW_WYRE_MERCHANT_ID_TEST=$RAINBOW_WYRE_MERCHANT_ID_TEST" >> .env
echo "ETHERSCAN_API_KEY=$ETHERSCAN_API_KEY" >> .env
echo "BRANCH_APP_DOMAIN=$BRANCH_APP_DOMAIN" >> .env
echo "BRANCH_KEY=$BRANCH_KEY" >> .env
echo "RAINBOW_MASTER_KEY=$RAINBOW_MASTER_KEY" >> .env
echo "DEV_SEEDS=\"$DEV_SEEDS\"" >> .env
echo "DEV_PKEY=\$DEV_PKEY" >> .env
echo "TEST_SEEDS=\"$TEST_SEEDS\"" >> .env
echo "IS_TESTING=$IS_TESTING" >> .env
echo "WYRE_TOKEN=$WYRE_TOKEN" >> .env
echo "WYRE_TOKEN_TEST=$WYRE_TOKEN_TEST" >> .env
echo "ENABLE_DEV_MODE=$ENABLE_DEV_MODE" >> .env
echo "GANACHE_URL=$GANACHE_URL" >> .env
echo "ETH_GAS_STATION_API_KEY=$ETH_GAS_STATION_API_KEY" >> .env
title: Generate .env file for testing
workflow_remote_access:
before_run: []
envs:
- opts:
is_expand: false
SENTRY_ENVIRONMENT: LocalRelease
after_run: []
steps:
- [email protected]: {}
- [email protected]: {}
inputs:
- content: sleep 2700
generate_dot_env_testflight:
steps:
inputs:
- content: |+
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
touch .env
echo "DATA_ORIGIN=$DATA_ORIGIN" >> .env
echo "INFURA_PROJECT_ID=$INFURA_PROJECT_ID" >> .env
echo "INFURA_PROJECT_ID_DEV=$INFURA_PROJECT_ID_DEV" >> .env
echo "REACT_APP_SEGMENT_API_WRITE_KEY=$REACT_APP_SEGMENT_API_WRITE_KEY" >> .env
echo "DATA_API_KEY=$DATA_API_KEY" >> .env
echo "DATA_ENDPOINT=$DATA_ENDPOINT" >> .env
echo "SENTRY_ENDPOINT=$SENTRY_ENDPOINT" >> .env
echo "SENTRY_ENVIRONMENT=$SENTRY_ENVIRONMENT" >> .env
echo "WYRE_ENDPOINT=$WYRE_ENDPOINT" >> .env
echo "WYRE_ACCOUNT_ID=$WYRE_ACCOUNT_ID" >> .env
echo "RAINBOW_WYRE_MERCHANT_ID=$RAINBOW_WYRE_MERCHANT_ID" >> .env
echo "WYRE_ENDPOINT_TEST=$WYRE_ENDPOINT_TEST" >> .env
echo "WYRE_ACCOUNT_ID_TEST=$WYRE_ACCOUNT_ID_TEST" >> .env
echo "RAINBOW_WYRE_MERCHANT_ID_TEST=$RAINBOW_WYRE_MERCHANT_ID_TEST" >> .env
echo "ETHERSCAN_API_KEY=$ETHERSCAN_API_KEY" >> .env
echo "BRANCH_APP_DOMAIN=$BRANCH_APP_DOMAIN" >> .env
echo "BRANCH_KEY=$BRANCH_KEY" >> .env
echo "RAINBOW_MASTER_KEY=$RAINBOW_MASTER_KEY" >> .env
echo "DEV_SEEDS=\"$DEV_SEEDS_PROD\"" >> .env
echo "DEV_PKEY=$DEV_PKEY_PROD" >> .env
echo "IS_TESTING=$IS_TESTING" >> .env
echo "WYRE_TOKEN=$WYRE_TOKEN" >> .env
echo "WYRE_TOKEN_TEST=$WYRE_TOKEN_TEST" >> .env
echo "ENABLE_DEV_MODE=$ENABLE_DEV_MODE" >> .env
echo "GANACHE_URL=$GANACHE_URL" >> .env
echo "ETH_GAS_STATION_API_KEY=$ETH_GAS_STATION_API_KEY" >> .env
title: Generate .env file for testflight
app:
envs:
- opts:
is_expand: false
SKIP_FLIPPER: 'true'