-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathbitrise.yml
273 lines (273 loc) · 8.53 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
---
format_version: '11'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: react-native
meta:
bitrise.io:
stack: osx-xcode-13.2.x
app:
envs:
- opts:
is_expand: false
WORKDIR: "."
- opts:
is_expand: false
EXAMPLE_WORKDIR: "./example"
- opts:
is_expand: false
DOCS_WORKDIR: "./docs"
- opts:
is_expand: false
EXAMPLE_ANDROID_PROJECT: "./example/android"
- opts:
is_expand: false
EXAMPLE_ANDROID_RELEASE_VARIANT: "release"
- opts:
is_expand: false
EXAMPLE_IOS_PROJECT: "./example/ios/reactnativestickyparallaxheaderexample.xcworkspace"
- opts:
is_expand: false
EXAMPLE_IOS_RELEASE_SCHEME: "reactnativestickyparallaxheaderexamplerelease"
trigger_map:
- pull_request_source_branch: '*'
pull_request_target_branch: master
workflow: lint
workflows:
lint:
description: >
Run ESLint & TypeScript
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: install
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: lint
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: typescript
- deploy-to-bitrise-io@2: {}
prod_android:
description: >
Create Android release build
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- cache-pull@2: {}
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: install
- yarn@0:
inputs:
- workdir: "$EXAMPLE_WORKDIR"
- command: install
- android-build@1:
inputs:
- build_type: apk
- project_location: "$EXAMPLE_ANDROID_PROJECT"
- variant: "$EXAMPLE_ANDROID_RELEASE_VARIANT"
- cache-push@2:
inputs:
- cache_paths: |-
$HOME/.rbenv
$EXAMPLE_WORKDIR/ios/Pods
$EXAMPLE_WORKDIR/node_modules
$WORKDIR/node_modules
$HOME/.gradle
$EXAMPLE_ANDROID_PROJECT/.gradle
- ignore_check_on_paths: |-
$HOME/.gradle/caches/*.lock
$EXAMPLE_ANDROID_PROJECT/.gradle/*.lock
$EXAMPLE_ANDROID_PROJECT/.gradle/*.bin
- deploy-to-bitrise-io@2: {}
prod_android_with_appium_tests:
description: >
Create Android release build and run Appium tests
steps:
- activate-ssh-key@4: { }
- git-clone@6: { }
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: install
- yarn@0:
inputs:
- workdir: "$EXAMPLE_WORKDIR"
- command: install
- android-build@1:
inputs:
- build_type: apk
- project_location: "$EXAMPLE_ANDROID_PROJECT"
- variant: "$EXAMPLE_ANDROID_RELEASE_VARIANT"
- deploy-to-bitrise-io@2: { }
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -ex
brew update
brew install jq
result=$(curl -X GET "https://api.bitrise.io/v0.1/apps/${BITRISE_APP_SLUG}/builds/${BITRISE_BUILD_SLUG}/artifacts" -H "accept: application/json" -H "Authorization: ${BITRISE_ACCESS_TOKEN}" | jq -r .data[0].slug)
artifactSlug=$(curl -X GET "https://api.bitrise.io/v0.1/apps/${BITRISE_APP_SLUG}/builds/${BITRISE_BUILD_SLUG}/artifacts/${result}" -H "accept: application/json" -H "Authorization: ${BITRISE_ACCESS_TOKEN}" | jq -r .data.expiring_download_url)
export APPIUM_ARTIFACT_URL=${artifactSlug}
echo "${APPIUM_ARTIFACT_URL}"
curl --location --request POST 'https://api.bitrise.io/v0.1/apps/a83b4e4adbd2a88d/builds' --header "Authorization: ${BITRISE_ACCESS_TOKEN}" --header 'Content-Type: application/json' --data-raw '{ "hook_info": { "type": "bitrise" }, "build_params": { "branch": "main", "workflow_id": "run_pixel_4", "environments": [{ "is_expand": true, "mapped_to": "APPIUM_ARTIFACT_URL", "value": "'"$APPIUM_ARTIFACT_URL"'" }]}}'
curl --location --request POST 'https://api.bitrise.io/v0.1/apps/a83b4e4adbd2a88d/builds' --header "Authorization: ${BITRISE_ACCESS_TOKEN}" --header 'Content-Type: application/json' --data-raw '{ "hook_info": { "type": "bitrise" }, "build_params": { "branch": "main", "workflow_id": "run_samsung_j7", "environments": [{ "is_expand": true, "mapped_to": "APPIUM_ARTIFACT_URL", "value": "'"$APPIUM_ARTIFACT_URL"'" }]}}'
title: Kick off appium tests
prod_ios:
description: >
Create iOS release build
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- cache-pull@2: {}
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
selected_version=$(cat $EXAMPLE_WORKDIR/.ruby-version)
rbenv_versions=$(rbenv versions)
if [[ $rbenv_versions =~ $selected_version ]]
then
$(rbenv local $selected_version)
else
$(rbenv install $selected_version)
fi
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: install
- yarn@0:
inputs:
- workdir: "$EXAMPLE_WORKDIR"
- command: install
- cocoapods-install@2: {}
- xcode-build-for-simulator@0:
inputs:
- project_path: '$EXAMPLE_IOS_PROJECT'
- scheme: '$EXAMPLE_IOS_RELEASE_SCHEME'
- simulator_device: 'iPhone 13'
- simulator_os_version: latest
- script:
inputs:
- content: |-
#!/bin/bash
zip -r $BITRISE_DEPLOY_DIR/app.zip $BITRISE_APP_DIR_PATH
- cache-push@2:
inputs:
- cache_paths: |-
$HOME/.rbenv
$EXAMPLE_WORKDIR/ios/Pods
$EXAMPLE_WORKDIR/node_modules
$WORKDIR/node_modules
$HOME/.gradle
$EXAMPLE_ANDROID_PROJECT/.gradle
- ignore_check_on_paths: |-
$HOME/.gradle/caches/*.lock
$EXAMPLE_ANDROID_PROJECT/.gradle/*.lock
$EXAMPLE_ANDROID_PROJECT/.gradle/*.bin
- deploy-to-bitrise-io@2: {}
_release:
description: >
Publish to NPM reusable workflow (template)
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- yarn@0:
inputs:
- workdir: "$WORKDIR"
- command: install
- yarn@0:
inputs:
- workdir: "$EXAMPLE_WORKDIR"
- command: install
- script:
inputs:
- content: |-
git config --global user.email "[email protected]"
git config --global user.name "netguru"
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
if [[ $PRE_RELEASE == true ]]
then
yarn release --preRelease=rc --ci --npm.skipChecks
else
yarn release --increment=$INCREMENT --ci --npm.skipChecks
fi
- deploy-to-bitrise-io@2: {}
pre-release:
description: >
Create release candidate and publish it to npm
envs:
- opts:
is_expand: false
PRE_RELEASE: true
after_run:
- _release
release-major:
description: >
Create major release and publish it to npm
envs:
- opts:
is_expand: false
INCREMENT: major
after_run:
- _release
release-minor:
description: >
Create minor release and publish it to npm
envs:
- opts:
is_expand: false
INCREMENT: minor
after_run:
- _release
release-patch:
description: >
Create patch release and publish it to npm
envs:
- opts:
is_expand: false
INCREMENT: patch
after_run:
- _release
docs-deploy:
description: >
Create docs release and deploy it to Github Pages
envs:
- opts:
is_expand: false
USE_SSH: true
- opts:
is_expand: false
GIT_USER: git
- opts:
is_expand: false
CURRENT_BRANCH: master
- opts:
is_expand: false
DEPLOYMENT_BRANCH: gh-pages
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- yarn@0:
inputs:
- workdir: "$DOCS_WORKDIR"
- command: install
- script:
inputs:
- content: |-
git config --global user.email "[email protected]"
git config --global user.name "netguru"
- yarn@0:
inputs:
- workdir: "$DOCS_WORKDIR"
- command: deploy
- deploy-to-bitrise-io@2: {}