-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
188 lines (184 loc) · 5.45 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
format_version: "11"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
app:
envs:
- PROJECT_LOCATION: .
opts:
is_expand: false
- MODULE: Pocket
opts:
is_expand: false
- PR_BUILD_VARIANT: teamReviewTeamRelease
opts:
is_expand: false
- _JAVA_OPTIONS: -Xmx6144M -XX:MaxMetaspaceSize=512m
opts:
is_expand: false
- RELEASE_BUILD_INFO_KEY: releaseBuildInfoKey
opts:
is_expand: false
- GRADLEW_PATH: ./gradlew
opts:
is_expand: false
meta:
bitrise.io:
machine_type: standard
stack: linux-docker-android-22.04
trigger_map:
- type: push
workflow: onMainUpdated
push_branch: main
- type: push
workflow: onReleaseBranchUpdated
push_branch: release-*.*.*
- type: push
workflow: onMergeQueueUpdated
push_branch: gh-readonly-queue/*
- type: pull_request
workflow: onPullRequest
pull_request_source_branch: '*'
pull_request_target_branch: '*'
workflows:
onMainUpdated:
after_run:
- publishAlphaToAppCenter
onMergeQueueUpdated:
after_run:
- runPreMergeChecks
onPullRequest:
after_run:
- runPreMergeChecks
onReleaseBranchUpdated:
steps:
- set-java-version@1:
inputs:
- set_java_version: "17"
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- cache-pull: {}
- script:
title: Update build version
inputs:
- content: |-
set -e
set -x
java -jar project-tools/tools.jar updateBuildVersionForRelease $BITRISE_GIT_BRANCH
versionName=$(java -jar project-tools/legacyTools.jar -printVersionName Pocket/build.gradle.kts)
versionCode=$(java -jar project-tools/legacyTools.jar -printVersionCode Pocket/build.gradle.kts)
echo $versionName
echo $versionCode
- script:
title: Decrypt secrets
inputs:
- content: secrets/decrypt.sh
- script:
title: Update merged manifest copy
inputs:
- content: |-
set -e
set -x
./gradlew Pocket:copyMergedManifest
- install-missing-android-tools:
inputs:
- gradlew_path: $PROJECT_LOCATION/gradlew
- android-build:
inputs:
- variant: playUnsignedRelease
- module: Pocket
- script:
title: Sign build
inputs:
- content: |-
set -e
set -x
curl -F "input=@./Pocket/build/outputs/apk/play/unsignedRelease/Pocket-play-unsignedRelease-unsigned.apk" -o ./Pocket/build/outputs/apk/play/unsignedRelease/signed.apk -H "Authorization: $EDGE_API_KEY" https://edge.prod.autograph.services.mozaws.net/sign
- deploy-to-bitrise-io@2:
inputs:
- notify_user_groups: none
- deploy_path: ./Pocket/build/outputs/apk/play/unsignedRelease/signed.apk
- google-play-deploy:
inputs:
- service_account_json_key_path: $BITRISEIO_GOOGLE_SERVICE_ACCOUNT_JSON_URL
- package_name: com.ideashower.readitlater.pro
- app_path: ./Pocket/build/outputs/apk/play/unsignedRelease/signed.apk
- track: internal
- status: completed
- script:
title: Push changes to github
inputs:
- script_file_path: null
- content: |-
set -e
set -x
git config --global user.name "Bitrise Bot"
git config --global user.email "[email protected]"
git checkout $BITRISE_GIT_BRANCH
git add .
git commit -m "chore(ci): prepare release [skip ci]"
git push origin $BITRISE_GIT_BRANCH
publishAlphaToAppCenter:
steps:
- set-java-version@1:
inputs:
- set_java_version: "17"
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone:
inputs:
- update_submodules: "no"
- cache-pull@2: {}
- script:
title: Update versionName
inputs:
- content: scripts/set-version-name-build-number.sh $BITRISE_BUILD_NUMBER
- script:
title: Decrypt secrets
inputs:
- content: secrets/decrypt.sh
- install-missing-android-tools:
inputs:
- gradlew_path: $PROJECT_LOCATION/gradlew
- android-build@1:
inputs:
- variant: teamATeamRelease
- module: Pocket
- deploy-to-bitrise-io@2:
inputs:
- notify_user_groups: none
- appcenter-deploy-android@2:
inputs:
- api_token: $APPCENTER_API_ID
- owner_name: pocket-app
- app_name: Android-Alpha-Team-Only
- release_notes: $BITRISE_BUILD_URL
- notify_testers: "no"
- app_path: $BITRISE_APK_PATH
- distribution_group: All-users-of-Android-Alpha-Team-Only
- debug: "yes"
- mapping_path: $BITRISE_MAPPING_PATH
- cache-push@2: {}
runPreMergeChecks:
steps:
- set-java-version@1:
inputs:
- set_java_version: "17"
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- cache-pull: {}
- script:
title: Decrypt secrets
inputs:
- content: secrets/decrypt.sh
- install-missing-android-tools: {}
- gradle-unit-test@1: {}
- android-build:
title: Review Build
inputs:
- variant: $PR_BUILD_VARIANT
- module: Pocket
- deploy-to-bitrise-io@2:
inputs:
- notify_user_groups: none