-
Notifications
You must be signed in to change notification settings - Fork 7
334 lines (275 loc) · 11.4 KB
/
pre-release.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
name: pre-release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-android-qa:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL_QA_RELEASE }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # https://github.com/actions/setup-java#supported-distributions
java-version: '17'
- name: Build debug APK
run: |
npx cap sync android
cd android/
./gradlew assembleDebug
- name: Upload debug APK and metadata to Artifacts
uses: actions/upload-artifact@v4
with:
name: app-debug.apk
path: ./android/app/build/outputs/apk/debug/app-debug.apk
- name: Upload debug metadata to Artifacts
uses: actions/upload-artifact@v4
with:
name: output-metadata.json
path: ./android/app/build/outputs/apk/debug/output-metadata.json
upload-android-qa:
runs-on: ubuntu-latest
needs: build-android-qa
steps:
- uses: actions/checkout@v4
- name: Download debug APK
uses: actions/download-artifact@v4
with:
name: app-debug.apk
- name: Download debug metadata
uses: actions/download-artifact@v4
with:
name: output-metadata.json
- name: Upload debug APK and metadata to release assets
uses: softprops/action-gh-release@v1
with:
files: |
./app-debug.apk
./output-metadata.json
build-android-prod:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # https://github.com/actions/setup-java#supported-distributions
java-version: '17'
- name: Build Android release bundle (AAB) for Google Play Console
run: |
npx cap sync android
cd android/
./gradlew bundleRelease
- name: Sign release AAB
uses: r0adkll/[email protected]
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE_FILE }}
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Upload release AAB to Artifacts
uses: actions/upload-artifact@v4
with:
name: app-release.aab
path: ./android/app/build/outputs/bundle/release/app-release.aab
deploy-play-store:
runs-on: ubuntu-latest
needs: build-android-prod
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Download release AAB
uses: actions/download-artifact@v4
with:
name: app-release.aab
- name: Create service_account.json
run: echo '${{ secrets.PLAY_CONSOLE_SERVICE_ACCOUNT_JSON }}' > service_account.json
- name: Deploy to Play Store (closed alpha track)
uses: r0adkll/[email protected]
with:
serviceAccountJson: service_account.json
packageName: io.numbersprotocol.capturelite
releaseFiles: ./app-release.aab
track: alpha
build-ios-prod:
runs-on: macos-14
timeout-minutes: 120
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Import the Code-Signing PKCS12 Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Download provisioning profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: io.numbersprotocol.capturelite
profile-type: 'IOS_APP_STORE'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYYMMDDHHmmss
- name: Build iOS Xcode Archive
run: |
npx cap sync ios
xcodebuild archive -workspace ios/App/App.xcworkspace -scheme App -sdk iphoneos -configuration Release -archivePath build/App.xcarchive -showBuildTimingSummary MARKETING_VERSION=${{ steps.version_check.outputs.version }} CURRENT_PROJECT_VERSION=${{ steps.current-time.outputs.formattedTime }} -allowProvisioningUpdates archive
- name: Export IPA from Xcode Archive
run: |
xcodebuild -exportArchive -archivePath build/App.xcarchive -exportPath build -exportOptionsPlist ios/App/ExportOptions.plist -allowProvisioningUpdates
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: App.ipa
path: build/App.ipa
- name: Save iOS build number
run: |
echo ${{ steps.current-time.outputs.formattedTime }} > build/ios-build-number.txt
- name: Upload iOS build number
uses: actions/upload-artifact@v4
with:
name: ios-build-number.txt
path: build/ios-build-number.txt
deploy-app-store:
runs-on: macos-14
needs: build-ios-prod
timeout-minutes: 120
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Download IPA
uses: actions/download-artifact@v4
with:
name: App.ipa
- name: Upload IPA to App Store (Testflight)
uses: Apple-Actions/upload-testflight-build@master
with:
app-path: ./App.ipa
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
get-ios-build-number:
runs-on: ubuntu-latest
needs: deploy-app-store
steps:
- uses: actions/checkout@v4
- name: Download iOS build number
uses: actions/download-artifact@v4
with:
name: ios-build-number.txt
- name: Set iOS build number as Environment Variable
run: |
IOS_BUILD=`cat ios-build-number.txt`
echo "ios_build_number=$IOS_BUILD" >> $GITHUB_ENV
create-github-release:
runs-on: ubuntu-latest
needs: [deploy-play-store, get-ios-build-number]
steps:
- uses: actions/checkout@v4
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Create GitHub prerelease
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: Thanks for following along! For more information check out the [CHANGELOG](https://github.com/numbersprotocol/capture-lite/blob/main/CHANGELOG.md).
prerelease: true
- name: Send Slack notification
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: reminder-releases
SLACK_COLOR: '#6EE4D3'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_MESSAGE: |
Version: ${{ steps.version_check.outputs.version }}
<https://github.com/numbersprotocol/capture-lite/releases/tag/${{ steps.version_check.outputs.version }}|GitHub Release Note>
APKs
- <https://drive.google.com/drive/folders/1NH-4mruBBubxHMfXF6VXaKRCQ76Ldg_n?usp=sharing|Google Drive>
- <https://play.google.com/apps/testing/io.numbersprotocol.capturelite|Google Play Closed Alpha Testing (release)>
iOS Testflight
Build: ${{ env.ios_build_number }}
A push notification will be sent to the device with TestFlight installed when the build is ready.
Notes
- Publishing process usually requires some time to complete, and thus the link provided above might still display the old version of the app. Please check the app version before download and install the app.
- This message is automatically sent from GitHub Action.
SLACK_TITLE: Capture Lite QA Release
SLACK_USERNAME: GitHub Action