-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbitrise.yml
359 lines (333 loc) · 10 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
app:
envs:
- BITRISE_WORKSPACE: Folio.xcworkspace
- BITRISE_SCHEME: Folio-Release-Staging
- SLACK_WEBHOOK_URL: https://hooks.slack.com/services/AAAAAAAAA/BBBBBBBBB/aaaaaaaaaaaaaaaaaaaaaaaa
- SLACK_CHANNEL: '#ios-ci'
- FASTLANE_DONT_STORE_PASSWORD: "1"
opts:
is_expand: false
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
format_version: "4"
project_type: ios
trigger_map:
- push_branch: master
workflow: test
- push_branch: v*
workflow: test
- pull_request_source_branch: _release/*
workflow: deliver
- pull_request_source_branch: _testflight/*
workflow: deliver-external
- pull_request_source_branch: _fabric-beta/*
workflow: deliver-internal
- pull_request_target_branch: '*'
workflow: test
workflows:
_prepare:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone:
inputs:
- update_submodules: "no"
- cache-pull: {}
- brew-install:
inputs:
- packages: carthage
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
bundle install --path=vendor/bundle --binstubs=vendor/bin
bundle exec fastlane download_build_cache
shouldUpload=false
if [ ! -d "Carthage" ]; then
Scripts/build_carthage
shouldUpload=true
fi
if [ ! -d "Pods" ]; then
Scripts/build_pods
shouldUpload=true
fi
if "${shouldUpload}"; then
bundle exec fastlane upload_build_cache
fi
title: Install dependencies
deliver:
after_run:
- deliver-internal
- deliver-external
deliver-external:
before_run:
- _prepare
envs:
- BITRISE_SCHEME: Folio-Release-Production
- BITRISE_CONFIG: Release
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
export SRCROOT=.
./Scripts/BuildPhases/SetBuildVariants-Production.sh
title: SetBuildVariants-Production
- ios-auto-provision:
inputs:
- team_id: EEZMTM2696
- project_path: $BITRISE_WORKSPACE
- configuration: $BITRISE_CONFIG
- generate_profiles: "yes"
- distribution_type: app-store
- xcode-archive:
inputs:
- export_method: app-store
- project_path: $BITRISE_WORKSPACE
- configuration: $BITRISE_CONFIG
- is_export_xcarchive_zip: "yes"
- force_provisioning_profile: ""
- output_tool: xcodebuild
- deploy-to-itunesconnect-deliver:
inputs:
- password: $ITUNES_CONNECT_PASSWORD
- itunescon_user: $ITUNES_CONNECT_ID
- app_id: $ITUNES_CONNECT_APP_APPLE_ID
- deploy-to-bitrise-io:
inputs:
- is_enable_public_page: "false"
- slack:
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: Bitrise CI(deliver-external) - OK
- api_token: $SLACK_API_TOKEN
- from_username_on_error: Bitrise CI(deliver-external) - FAILED
deliver-internal:
before_run:
- _prepare
envs:
- BITRISE_SCHEME: Folio-Release-Staging
- BITRISE_CONFIG: Release
- CRASHLYTICS_IOS_TESTERS: tester-iOS
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
export SRCROOT=.
./Scripts/BuildPhases/SetBuildVariants-Staging.sh
title: SetBuildVariants-Staging
- ios-auto-provision:
inputs:
- distribution_type: ad-hoc
- team_id: AAAAAA1111
- configuration: $BITRISE_CONFIG
- generate_profiles: "yes"
- project_path: $BITRISE_WORKSPACE
- xcode-archive:
inputs:
- project_path: $BITRISE_WORKSPACE
- configuration: $BITRISE_CONFIG
- force_provisioning_profile: ""
- export_method: ad-hoc
- is_export_xcarchive_zip: "yes"
- deploy-to-bitrise-io: {}
- fabric-crashlytics-beta-deploy:
inputs:
- build_secret: $CRASHLYTICS_BUILD_SECRET
- group_aliases_list: $CRASHLYTICS_IOS_TESTERS
- api_key: $CRASHLYTICS_API_TOKEN
- slack:
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: Bitrise CI(deliver-internal) - OK
- api_token: $SLACK_API_TOKEN
- from_username_on_error: Bitrise CI(deliver-internal) - FAILED
nightly-build:
after_run:
- test
before_run: []
nightly-tests:
before_run:
- _prepare
steps:
- swiftlint:
inputs:
- linting_path: .
- strict: "yes"
- script:
inputs:
- content: |
#!/bin/bash
set -ex
sudo systemsetup -settimezone Asia/Tokyo
export NSUnbufferedIO=YES
BRANCH=${BITRISEIO_GIT_BRANCH_DEST:-$BITRISE_GIT_BRANCH}
DIFF_FILES="$(git diff --name-only origin/${BRANCH})"
CHENGE_SWIFTGEN_FILE=$(echo "$DIFF_FILES" | grep 'Swiftgen/ImageAssets.swift' || true)
if [ -n "$CHENGE_SWIFTGEN_FILE" ]; then
bundle exec fastlane image_assets_tests
fi
bundle exec fastlane folio_nightly_tests
ruby Scripts/coverage.rb Folio
bundle exec fastlane redux_tests
ruby Scripts/coverage.rb Redux
bundle exec fastlane notification_service_tests
ruby Scripts/coverage.rb NotificationServiceLib
bash <(curl -s https://codecov.io/bash) -f coverage.txt -t ${CODECOV_TOKEN}
title: Test
- cache-push:
inputs:
- cache_paths: |-
$BITRISE_CACHE_DIR
./vendor -> ./Gemfile.lock
- ignore_check_on_paths: ""
- deploy-to-bitrise-io:
inputs:
- is_compress: "true"
- is_enable_public_page: "false"
- deploy_path: ${BITRISE_SOURCE_DIR}/FolioTests/FailureDiffs
- slack:
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: OK
- from_username_on_error: ERROR
- message_on_error: |-
$BITRISE_GIT_MESSAGE
- pretext: '*Test Succeeded!*'
- pretext_on_error: '*Test Failed!*'
- api_token: $SLACK_API_TOKEN
run_if: .IsBuildFailed
refresh-dSYMs:
before_run:
- _prepare
description: Run fastlane refresh_dsyms to update dSYM on Bugsnag
envs:
- CRASHLYTICS_API_TOKEN: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
bundle exec fastlane refresh_dsyms
title: Refresh dSYMs
renew-build-cache:
before_run:
- _prepare
steps:
inputs:
- content: |
#!/usr/bin/env bash
set -ex
rm -rf Carthage
rm -rf Pods
Scripts/build_dependencies
bundle exec fastlane renew_build_cache
title: Renew build cache
sync-bitrise-yml:
before_run:
- _prepare
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
bundle exec fastlane sync_bitrise_yml
title: Sync bitrise.yml
test:
before_run:
- _prepare
steps:
- swiftlint:
inputs:
- linting_path: .
- strict: "yes"
- script:
inputs:
- content: |
#!/bin/bash
set -ex
sudo systemsetup -settimezone Asia/Tokyo
export NSUnbufferedIO=YES
BRANCH=${BITRISEIO_GIT_BRANCH_DEST:-$BITRISE_GIT_BRANCH}
DIFF_FILES="$(git diff --name-only origin/${BRANCH})"
CHENGE_SWIFTGEN_FILE=$(echo "$DIFF_FILES" | grep 'Swiftgen/ImageAssets.swift' || true)
if [ -n "$CHENGE_SWIFTGEN_FILE" ]; then
bundle exec fastlane image_assets_tests
fi
bundle exec fastlane folio_tests
ruby Scripts/coverage.rb Folio
bundle exec fastlane redux_tests
ruby Scripts/coverage.rb Redux
bundle exec fastlane notification_service_tests
ruby Scripts/coverage.rb NotificationServiceLib
bash <(curl -s https://codecov.io/bash) -f coverage.txt -t ${CODECOV_TOKEN}
title: Test
- cache-push:
inputs:
- cache_paths: |-
$BITRISE_CACHE_DIR
./vendor -> ./Gemfile.lock
- ignore_check_on_paths: ""
- deploy-to-bitrise-io:
inputs:
- is_compress: "true"
- is_enable_public_page: "false"
- deploy_path: ${BITRISE_SOURCE_DIR}/FolioTests/FailureDiffs
- slack:
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: OK
- from_username_on_error: ERROR
- message_on_error: |-
$BITRISE_GIT_MESSAGE
- pretext: '*Test Succeeded!*'
- pretext_on_error: '*Test Failed!*'
- api_token: $SLACK_API_TOKEN
run_if: .IsBuildFailed
update-dependencies:
before_run:
- _prepare
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [ "$CI" = true ] ; then
bundle exec pod keys set MarketoAccountId $MARKETO_ACCOUNT_ID Folio
bundle exec pod keys set MarketoSecretKey $MARKETO_SECRET_KEY Folio
fi
bundle exec fastlane update_dependencies
title: Update Dependencies
update-license-plist:
before_run:
- _prepare
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
bundle exec fastlane update_license_list
title: Update License Plist
update-tools:
before_run:
- _prepare
steps:
- script:
inputs:
- content: |
#!/usr/bin/env bash
set -ex
bundle exec fastlane update_tools
title: Update Developer Tools