-
Notifications
You must be signed in to change notification settings - Fork 2
384 lines (353 loc) · 15.2 KB
/
publish_to_appcenter.yaml
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
name: Publish
on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
android_internal:
description: 'Android Internal'
required: false
default: true
type: boolean
android_beta:
description: 'Android Beta'
required: false
default: false
type: boolean
ios_internal:
description: 'iOS Internal'
required: false
default: true
type: boolean
ios_beta:
description: 'iOS Beta'
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
flutter_channel: 'stable'
flutter_version: '3.0.2'
java_version: '12.x'
ios_device: 'iPhone 11 Pro (14.5)'
# Common environment variables used inside ./build_scripts files
GITHUB_USERNAME: 'xayn-admin'
# GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
FASTLANE_SKIP_UPDATE_CHECK: '1'
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BLUE_DEPLOYMENT_WEBHOOK_URL }}
jobs:
publish_ios_internal:
name: Publish iOS Internal
if: (github.event_name == 'push' && !contains(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.ios_internal == 'true')
runs-on: macos-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH }}
name: id_rsa_github
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: |
Host github.com
IdentityFile ~/.ssh/id_rsa_github
if_key_exists: replace
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: |
/Users/runner/hostedtoolcache/flutter
~/application/ios/Pods
key: ios-flutter-${{ env.flutter_version }}
restore-keys: |
ios-flutter-cache-
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build and submit new internal iOS version to app center
timeout-minutes: 60
env:
PROVISIONING_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
APPCENTER_IOS_INTERNAL_TOKEN: ${{ secrets.APPCENTER_IOS_INTERNAL_TOKEN }}
SEARCH_API_SECRET_DEBUG: ${{ secrets.SEARCH_API_SECRET_DEBUG }}
SEARCH_API_SECRET_PRODUCTION: ${{ secrets.SEARCH_API_SECRET_PRODUCTION }}
INSTABUG_TOKEN_DEBUG: ${{ secrets.INSTABUG_TOKEN_DEBUG }}
INSTABUG_TOKEN_PRODUCTION: ${{ secrets.INSTABUG_TOKEN_PRODUCTION }}
MIXPANEL_TOKEN_DEBUG: ${{ secrets.MIXPANEL_TOKEN_DEBUG }}
MIXPANEL_TOKEN_PRODUCTION: ${{ secrets.MIXPANEL_TOKEN_PRODUCTION }}
APPSFLYER_DEV_KEY: ${{ secrets.APPSFLYER_DEV_KEY }}
REVENUE_CAT_SDK_KEY_ANDROID: ${{ secrets.REVENUE_CAT_SDK_KEY_ANDROID }}
REVENUE_CAT_SDK_KEY_IOS: ${{ secrets.REVENUE_CAT_SDK_KEY_IOS }}
PROFILES: ${{ secrets.PROFILES }}
AIRSHIP_INTERNAL_KEY: ${{ secrets.AIRSHIP_INTERNAL_KEY }}
AIRSHIP_INTERNAL_SECRET: ${{ secrets.AIRSHIP_INTERNAL_SECRET }}
AIRSHIP_PROD_KEY: ${{ secrets.AIRSHIP_PROD_KEY }}
AIRSHIP_PROD_SECRET: ${{ secrets.AIRSHIP_PROD_SECRET }}
RCONFIG_ACCESS_KEY: ${{ secrets.RCONFIG_ACCESS_KEY }}
RCONFIG_SECRET_KEY: ${{ secrets.RCONFIG_SECRET_KEY }}
GOOGLE_SERVICES_INTERNAL_JSON: ${{ secrets.GOOGLE_SERVICES_INTERNAL_JSON }}
GOOGLE_SERVICES_PROD_JSON: ${{ secrets.GOOGLE_SERVICES_PROD_JSON }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
working-directory: ./application
run: |
fastlane publish platform:ios build_type:release download_profile:true flavor:internal skslPath:flutter_01.sksl.json
publish_ios_beta:
outputs:
message: ${{ env.SLACK_MESSAGE || 'Build Failed' }}
status: ${{ env.SLACK_STATUS || 'failure' }}
name: Publish iOS Beta
if: (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.ios_beta == 'true')
runs-on: macos-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH }}
name: id_rsa_github
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: |
Host github.com
IdentityFile ~/.ssh/id_rsa_github
if_key_exists: replace
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: |
/Users/runner/hostedtoolcache/flutter
~/application/ios/Pods
key: ios-flutter-${{ env.flutter_version }}
restore-keys: |
ios-flutter-cache-
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build and submit new internal iOS version to app center
timeout-minutes: 60
env:
PROVISIONING_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
APPCENTER_IOS_BETA_TOKEN: ${{ secrets.APPCENTER_IOS_BETA_TOKEN }}
SEARCH_API_SECRET_DEBUG: ${{ secrets.SEARCH_API_SECRET_DEBUG }}
SEARCH_API_SECRET_PRODUCTION: ${{ secrets.SEARCH_API_SECRET_PRODUCTION }}
INSTABUG_TOKEN_DEBUG: ${{ secrets.INSTABUG_TOKEN_DEBUG }}
INSTABUG_TOKEN_PRODUCTION: ${{ secrets.INSTABUG_TOKEN_PRODUCTION }}
MIXPANEL_TOKEN_DEBUG: ${{ secrets.MIXPANEL_TOKEN_DEBUG }}
MIXPANEL_TOKEN_PRODUCTION: ${{ secrets.MIXPANEL_TOKEN_PRODUCTION }}
APPSFLYER_DEV_KEY: ${{ secrets.APPSFLYER_DEV_KEY }}
REVENUE_CAT_SDK_KEY_ANDROID: ${{ secrets.REVENUE_CAT_SDK_KEY_ANDROID }}
REVENUE_CAT_SDK_KEY_IOS: ${{ secrets.REVENUE_CAT_SDK_KEY_IOS }}
PROFILES: ${{ secrets.PROFILES }}
AIRSHIP_INTERNAL_KEY: ${{ secrets.AIRSHIP_INTERNAL_KEY }}
AIRSHIP_INTERNAL_SECRET: ${{ secrets.AIRSHIP_INTERNAL_SECRET }}
AIRSHIP_PROD_KEY: ${{ secrets.AIRSHIP_PROD_KEY }}
AIRSHIP_PROD_SECRET: ${{ secrets.AIRSHIP_PROD_SECRET }}
RCONFIG_ACCESS_KEY: ${{ secrets.RCONFIG_ACCESS_KEY }}
RCONFIG_SECRET_KEY: ${{ secrets.RCONFIG_SECRET_KEY }}
GOOGLE_SERVICES_INTERNAL_JSON: ${{ secrets.GOOGLE_SERVICES_INTERNAL_JSON }}
GOOGLE_SERVICES_PROD_JSON: ${{ secrets.GOOGLE_SERVICES_PROD_JSON }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
working-directory: ./application
run: |
fastlane publish platform:ios build_type:release download_profile:true flavor:beta store:true skslPath:flutter_01.sksl.json
echo "SLACK_MESSAGE=$( cat report.log )" >> $GITHUB_ENV
echo "SLACK_STATUS=success" >> $GITHUB_ENV
publish_android_internal:
name: Publish Android Internal
if: (github.event_name == 'push' && !contains(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.android_internal == 'true')
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH }}
name: id_rsa_github
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: |
Host github.com
IdentityFile ~/.ssh/id_rsa_github
if_key_exists: replace
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Fix fastlane permissions
run: sudo chmod -R a+w /var/lib/gems/
- name: Build and submit new internal Android version to app center
timeout-minutes: 60
env:
PROVISIONING_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
APPCENTER_ANDROID_INTERNAL_TOKEN: ${{ secrets.APPCENTER_ANDROID_INTERNAL_TOKEN }}
SEARCH_API_SECRET_DEBUG: ${{ secrets.SEARCH_API_SECRET_DEBUG }}
SEARCH_API_SECRET_PRODUCTION: ${{ secrets.SEARCH_API_SECRET_PRODUCTION }}
INSTABUG_TOKEN_DEBUG: ${{ secrets.INSTABUG_TOKEN_DEBUG }}
INSTABUG_TOKEN_PRODUCTION: ${{ secrets.INSTABUG_TOKEN_PRODUCTION }}
MIXPANEL_TOKEN_DEBUG: ${{ secrets.MIXPANEL_TOKEN_DEBUG }}
MIXPANEL_TOKEN_PRODUCTION: ${{ secrets.MIXPANEL_TOKEN_PRODUCTION }}
APPSFLYER_DEV_KEY: ${{ secrets.APPSFLYER_DEV_KEY }}
REVENUE_CAT_SDK_KEY_ANDROID: ${{ secrets.REVENUE_CAT_SDK_KEY_ANDROID }}
REVENUE_CAT_SDK_KEY_IOS: ${{ secrets.REVENUE_CAT_SDK_KEY_IOS }}
ANDROID_RELEASE_KEYSTORE: ${{ secrets.ANDROID_RELEASE_KEYSTORE }}
AIRSHIP_INTERNAL_KEY: ${{ secrets.AIRSHIP_INTERNAL_KEY }}
AIRSHIP_INTERNAL_SECRET: ${{ secrets.AIRSHIP_INTERNAL_SECRET }}
AIRSHIP_PROD_KEY: ${{ secrets.AIRSHIP_PROD_KEY }}
AIRSHIP_PROD_SECRET: ${{ secrets.AIRSHIP_PROD_SECRET }}
RCONFIG_ACCESS_KEY: ${{ secrets.RCONFIG_ACCESS_KEY }}
RCONFIG_SECRET_KEY: ${{ secrets.RCONFIG_SECRET_KEY }}
GOOGLE_SERVICES_INTERNAL_JSON: ${{ secrets.GOOGLE_SERVICES_INTERNAL_JSON }}
GOOGLE_SERVICES_PROD_JSON: ${{ secrets.GOOGLE_SERVICES_PROD_JSON }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
working-directory: ./application
run: |
fastlane publish platform:android build_type:release flavor:internal
publish_android_beta:
outputs:
message: ${{ env.SLACK_MESSAGE || 'Build Failed' }}
status: ${{ env.SLACK_STATUS || 'failure' }}
name: Publish Android Beta
if: (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.android_beta == 'true')
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH }}
name: id_rsa_github
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: |
Host github.com
IdentityFile ~/.ssh/id_rsa_github
if_key_exists: replace
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ env.flutter_channel }}
flutter-version: ${{ env.flutter_version }}
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.PUB_CACHE }}
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
build-pubspec-
- name: Fix fastlane permissions
run: sudo chmod -R a+w /var/lib/gems/
- name: Build and submit new internal Android version to app center
timeout-minutes: 60
env:
PROVISIONING_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
APPCENTER_ANDROID_BETA_TOKEN: ${{ secrets.APPCENTER_ANDROID_BETA_TOKEN }}
SEARCH_API_SECRET_DEBUG: ${{ secrets.SEARCH_API_SECRET_DEBUG }}
SEARCH_API_SECRET_PRODUCTION: ${{ secrets.SEARCH_API_SECRET_PRODUCTION }}
INSTABUG_TOKEN_DEBUG: ${{ secrets.INSTABUG_TOKEN_DEBUG }}
INSTABUG_TOKEN_PRODUCTION: ${{ secrets.INSTABUG_TOKEN_PRODUCTION }}
MIXPANEL_TOKEN_DEBUG: ${{ secrets.MIXPANEL_TOKEN_DEBUG }}
MIXPANEL_TOKEN_PRODUCTION: ${{ secrets.MIXPANEL_TOKEN_PRODUCTION }}
APPSFLYER_DEV_KEY: ${{ secrets.APPSFLYER_DEV_KEY }}
REVENUE_CAT_SDK_KEY_ANDROID: ${{ secrets.REVENUE_CAT_SDK_KEY_ANDROID }}
REVENUE_CAT_SDK_KEY_IOS: ${{ secrets.REVENUE_CAT_SDK_KEY_IOS }}
ANDROID_RELEASE_KEYSTORE: ${{ secrets.ANDROID_RELEASE_KEYSTORE }}
AIRSHIP_INTERNAL_KEY: ${{ secrets.AIRSHIP_INTERNAL_KEY }}
AIRSHIP_INTERNAL_SECRET: ${{ secrets.AIRSHIP_INTERNAL_SECRET }}
AIRSHIP_PROD_KEY: ${{ secrets.AIRSHIP_PROD_KEY }}
AIRSHIP_PROD_SECRET: ${{ secrets.AIRSHIP_PROD_SECRET }}
RCONFIG_ACCESS_KEY: ${{ secrets.RCONFIG_ACCESS_KEY }}
RCONFIG_SECRET_KEY: ${{ secrets.RCONFIG_SECRET_KEY }}
GOOGLE_SERVICES_INTERNAL_JSON: ${{ secrets.GOOGLE_SERVICES_INTERNAL_JSON }}
GOOGLE_SERVICES_PROD_JSON: ${{ secrets.GOOGLE_SERVICES_PROD_JSON }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
working-directory: ./application
run: |
fastlane publish platform:android build_type:release flavor:beta store:true
echo "SLACK_MESSAGE=$( cat report.log )" >> $GITHUB_ENV
echo "SLACK_STATUS=success" >> $GITHUB_ENV
slack-notification-android-beta:
needs: publish_android_beta
uses: ./.github/workflows/slack-notification.yaml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
message: ${{ needs.publish_android_beta.outputs.message }}
status: ${{ needs.publish_android_beta.outputs.status }}
slack-notification-ios-beta:
needs: publish_ios_beta
uses: ./.github/workflows/slack-notification.yaml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
message: ${{ needs.publish_ios_beta.outputs.message }}
status: ${{ needs.publish_ios_beta.outputs.status }}