forked from FutureWorkshops/steps-sign-apk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
224 lines (210 loc) · 8.01 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
format_version: 8
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- BITRISE_STEP_GIT_CLONE_URL: https://github.com/bitrise-steplib/steps-sign-apk.git
- SAMPLE_APP_REPOSITORY_URL: https://github.com/bitrise-samples/sample-apps-android-abi-split.git
- BRANCH: master
- GRADLEW_PATH: "./gradlew"
# define these in your .bitrise.secrets.yml
- BITRISEIO_ANDROID_KEYSTORE_URL: $BITRISEIO_ANDROID_KEYSTORE_URL
- BITRISEIO_ANDROID_KEYSTORE_PASSWORD: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD
- BITRISEIO_ANDROID_KEYSTORE_ALIAS: $BITRISEIO_ANDROID_KEYSTORE_ALIAS
- BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD
workflows:
# ----------------------------------------------------------------
# --- workflow to Test this Step
ci:
before_run:
- audit-this-step
steps:
- go-list:
- golint:
- errcheck:
- go-test:
after_run:
- test_apk
- test_bundle
test_apk:
envs:
- GRADLE_TASK: assembleRelease
- APK_FILE_INCLUDE_FILTER: "*.apk"
after_run:
- create_build_artifact
- test
test_bundle:
envs:
- GRADLE_TASK: bundleRelease
- APK_FILE_INCLUDE_FILTER: "*.aab"
after_run:
- create_build_artifact
- test
create_build_artifact:
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test/_tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -x
if [[ -z "${SAMPLE_APP_REPOSITORY_URL}" ]]; then
echo "error: there is no SAMPLE_APP_URL env var specified"
exit 1
elif [[ -z "${COMMIT}" && -z "${BRANCH}" ]]; then
echo "error: can't checkout: there is no BRANCH or COMMIT env var specified"
exit 1
fi
git init
git remote add origin "${SAMPLE_APP_REPOSITORY_URL}"
git fetch || exit 1
[[ -n "${COMMIT}" ]] && git checkout "${COMMIT}" || git checkout "${BRANCH}"
inputs:
- ndk_revision: '16'
run_if: ".IsCI"
- gradle-runner:
inputs:
- gradle_task: "$GRADLE_TASK"
- gradlew_path: "$GRADLEW_PATH"
- apk_file_include_filter: $APK_FILE_INCLUDE_FILTER
test:
steps:
- path::./:
is_skippable: true
title: Step Test - keystore pass == key pass with Jar signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_1_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_1
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_1
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_1
- path::./:
is_skippable: true
title: Step Test - keystore pass == key pass with APK signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_1_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_1
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_1
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_1
- use_apk_signer: true
- path::./:
is_skippable: true
title: Step Test - keystore pass != key pass with Jar signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_2_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_2
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_2
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_2
- path::./:
is_skippable: true
title: Step Test - keystore pass != key pass with APK signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_2_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_2
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_2
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_2
- use_apk_signer: true
- path::./:
is_skippable: true
title: Step Test - default alias
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_3_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_3
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_3
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_3
- path::./:
is_skippable: true
title: Step Test - default alias with APK signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_3_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_3
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_3
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_3
- use_apk_signer: true
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks)
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) with APK signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- use_apk_signer: true
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) + custom artifact name
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- output_name: "test-artifact-name"
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) + custom artifact name with APK signer
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- output_name: "test-artifact-name"
- use_apk_signer: true
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) + custom artifact name second time to see collisions if any
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- output_name: "test-artifact-name"
_go_tests:
steps:
- go-list:
- golint:
- errcheck:
- go-test:
# ----------------------------------------------------------------
# --- Utility workflows
dep-update:
title: Dep update
description: |
Used for updating bitrise dependencies with dep
steps:
- script:
title: Dependency update
inputs:
- content: |-
#!/bin/bash
set -ex
go get -u -v github.com/golang/dep/cmd/dep
dep ensure -v
dep ensure -v -update
# ----------------------------------------------------------------
# --- workflows to Share this step into a Step Library
audit-this-step:
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
stepman audit --step-yml ./step.yml