-
Notifications
You must be signed in to change notification settings - Fork 2
/
bitrise.yml
271 lines (249 loc) · 7.75 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
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
workflows:
_buildAbacus:
description: Build and push abacus to local cache
steps:
- script@1:
inputs:
- is_debug: 'yes'
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x
# write your script here
echo "Pulling Abacus!"
git clone git@github.com:dydxprotocol/abacus.git || exit 1
cd abacus || exit 1
git checkout ci || exit 1
cd ..
- cache-pull@2: {}
- script@1:
inputs:
- content: "#!/usr/bin/env bash\n# fail if any commands fails\nset -e\n# make
pipelines' return status equal the last command to exit with a non-zero
status, or zero if all commands exit successfully\nset -o pipefail\n#
debug log\nset -x\n\ncd abacus \ngit checkout ci\n./gradlew publishJvmPublicationToMavenLocal"
- cache-push@2: {}
envs:
- ABACUS_GIT_REPO_URL: git@github.com:dydxprotocol/abacus.git
opts:
is_expand: false
_buildAbacusIfRequired:
description: Build and push abacus to local cache
steps:
- git-clone@8:
inputs:
- clone_depth: '1'
- commit: ''
- repository_url: "$ABACUS_GIT_REPO_URL"
- clone_into_dir: "$BITRISE_SOURCE_DIR/abacus"
- update_submodules: 'no'
- branch: ci
- cache-pull@2: {}
- script@1:
inputs:
- is_debug: 'yes'
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
# set -o pipefail
# debug log
set -x
cd abacus
ABACUS_VERSION="1.0.2"
mvn dependency:go-offline
DEP=$(./gradlew --console plain -q v4:app:dependencyInsight --configuration debugAndroidTestCompileClasspath --dependency "exchange.dydx.abacus:abacus-jvm:1.0.2")
[[ ! -z "$DEP" ]] && echo "Found artifact" && exit 0 || echo "Did not find artifact"
#./gradlew publishJvmPublicationToMavenLocal
DEP=$(./gradlew --console plain -q v4:app:dependencyInsight --configuration debugAndroidTestCompileClasspath --dependency "exchange.dydx.abacus:abacus-jvm:1.0.2")
[[ ! -z "$DEP" ]] && echo "Found artifact after build" && exit 0 || echo "Did not find artifact after build" && exit 1
- cache-push@2: {}
envs:
- ABACUS_GIT_REPO_URL: git@github.com:dydxprotocol/abacus.git
opts:
is_expand: false
_buildApp:
description: Build Android app (v4)
steps:
- set-java-version@1:
inputs:
- set_java_version: '17'
- git-clone@8: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x
# write your script here
echo "Pulling Veronica!"
cd ..
git clone git@github.com:dydxprotocol/veronica-v4.git
# or run a script from your repository, like:
# bash ./path/to/script.sh
# not just bash, e.g.:
# ruby ./path/to/script.rb
title: Script (Pulling Veronica)
- cache-pull@2: {}
- install-missing-android-tools@3:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- android-lint@0:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$VARIANT"
- android-unit-test@1:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$VARIANT"
- android-build@1:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- app_path_pattern: |-
*/v4/app/build/outputs/apk/*.apk
*/v4/app/build/outputs/bundle/*.aab
- variant: "$VARIANT"
- cache-push@2: {}
_withSsh:
description: Set up Auth and Env Vars
steps:
- activate-ssh-key@4: {}
- script@1:
inputs:
- content: |
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
envman add --key=DYDX_DATE_MM_DD --value="$(date +"%m-%d")"
envs:
- ABACUS_GIT_REPO_URL: git@github.com:dydxprotocol/abacus.git
opts:
is_expand: false
build:
description: 'Run CI / release build. Triggers based on build/* branches. Artifacts
are discarded.
'
envs:
- VARIANT: release
opts:
is_expand: false
before_run:
- _withSsh
- _buildApp
deploy:
description: 'Deploys release build using [Deploy to bitrise.io Step](https://devcenter.bitrise.io/en/getting-started/getting-started-with-android-apps.html#deploying-an-android-app-to-bitrise-io-53056).
'
steps:
- change-android-versioncode-and-versionname@1:
inputs:
- build_gradle_path: "${BITRISE_SOURCE_DIR}/${MODULE_PATH}/build.gradle"
- sign-apk@1:
inputs:
- use_apk_signer: 'true'
- output_name: dydx_${ANDROID_VERSION_NAME}_${BITRISE_TRIGGERED_WORKFLOW_TITLE}_${BITRISE_BUILD_NUMBER}
- deploy-to-bitrise-io@2: {}
envs:
- VARIANT: release
opts:
is_expand: false
before_run:
- build
primary:
description: |
Run on every PR.
Next steps:
- Check out [Getting started with Android apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-android-apps.html).
steps:
- deploy-to-bitrise-io@2: {}
envs:
- VARIANT: debug
opts:
is_expand: false
before_run:
- _withSsh
- _buildApp
release:
description: 'Official Release Workflow (protected by PR)
'
envs:
- VARIANT: release
opts:
is_expand: false
before_run:
- deploy
steps:
- git-tag@1:
inputs:
- tag_message: |-
$BITRISE_PUBLIC_INSTALL_PAGE_URL_MAP
$BITRISE_PERMANENT_DOWNLOAD_URL_MAP
- tag: v${ANDROID_VERSION_NAME} (b${BITRISE_BUILD_NUMBER})
testBuildAbacus:
description: 'This workflow can be triggered to test the _buildAbacus workflow.
'
envs:
- VARIANT: debug
opts:
is_expand: false
before_run:
- _withSsh
- _buildAbacus
weekly:
description: 'Weekly Build (Friday @ 000 UTC)
'
envs:
- VARIANT: release
opts:
is_expand: false
before_run:
- deploy
steps:
- git-tag@1:
inputs:
- tag_message: |-
$BITRISE_PUBLIC_INSTALL_PAGE_URL_MAP
$BITRISE_PERMANENT_DOWNLOAD_URL_MAP
- tag: w/${DYDX_DATE_MM_DD} (${BITRISE_BUILD_NUMBER})
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: standard
app:
envs:
- PROJECT_LOCATION: "."
opts:
is_expand: false
- opts:
is_expand: false
MODULE: v4:app
- opts:
is_expand: false
MODULE_PATH: v4/app
trigger_map:
- push_branch: releases/*
workflow: release
- push_branch: build/*
workflow: build
- push_branch: deploy/*
workflow: deploy
- pull_request_source_branch: "*"
pull_request_target_branch: main
workflow: primary