-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
612 lines (563 loc) · 27.6 KB
/
Copy pathaction.yml
File metadata and controls
612 lines (563 loc) · 27.6 KB
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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
name: 'Flutter Actions Suite'
description: 'Builds a Flutter app for iOS, Android, Web, and Desktop, and deploys it.'
author: 'Spaccesi'
branding:
icon: 'layers'
color: 'blue'
inputs:
# Flutter configuration inputs
flutter-version:
description: 'The Flutter version to use.'
required: false
default: ''
flutter-channel:
description: 'The Flutter channel to use (stable, beta, dev, master).'
required: false
default: 'stable'
# Prepare step inputs
run-build-runner:
description: 'Whether to run build_runner for code generation. This will run build_runner for all packages in the repository that have a build_runner dependency on pubspec.yaml.'
required: false
default: 'false'
run-gen-l10n:
description: 'Whether to run gen-l10n for code generation. This will run gen-l10n for all packages in the repository that have intl dependency on pubspec.yaml.'
required: false
default: 'false'
gen-l10n-fails-if-untranslated:
description: 'Whether to fail the gen-l10n step if untranslated strings are found. This will check for the presence of an untranslated-messages-file in the l10n configuration file and fail if the file is generated and contains untranslated strings.'
required: false
default: 'false'
# Check step inputs
run-test:
description: 'Whether to run tests.'
required: false
default: 'false'
run-analyze:
description: 'Whether to run flutter analyze.'
required: false
default: 'false'
run-license-check:
description: 'Whether to check for licenses of dependencies.'
required: false
default: 'false'
test-run-coverage:
description: 'Whether to run tests with coverage.'
required: false
default: 'false'
analyze-fails-if-infos:
description: 'Whether to fail the analyze step if info level issues are found.'
required: false
default: 'false'
analyze-fails-if-warnings:
description: 'Whether to fail the analyze step if warning level issues are found.'
required: false
default: 'false'
licenses-conf-path:
description: 'Path to a YAML file containing a list of compatible licenses. Required if run-license-check is set to true. The YAML file should have the following format: compatible_licenses: - MIT - BSD-3-Clause - Apache-2.0'
required: false
default: ''
test-create-coverage-report:
description: 'Whether to create a coverage report based on the generated coverage data using lcov and genhtml.'
required: false
default: 'false'
# General Build step inputs
build-platforms:
description: 'List of platform to build. Be aware some platform builds need to be run on specific OS. Available options: android-apk, android-appbundle, ios, web, windows, macos, linux.'
required: false
publish-destinations:
description: 'List of platforms where to publish the built app. Be aware build needs to be run first and that not every destination is available for every platfomr. Available options: play-store, microsoft-store, ios-app-store, macos-app-store, snap-store, firebase-app-distribution, github-pages, firebase-hosting.'
required: false
build-mode:
description: 'The build mode to use. Available options: debug, profile, release.'
required: false
default: 'release'
build-name:
description: 'The build name to use for the app. This is typically used as the version name shown to users. If not set, the version from pubspec.yaml will be used.'
required: false
build-number:
description: 'The build number to use for the app. This is typically used as the internal version number. If not set, the version from pubspec.yaml will be used.'
required: false
flavor:
description: 'The Flutter flavor to build. If not set, the default flavor will be built.'
required: false
dart-define:
description: 'Additional Dart define variables to pass to the Flutter build command. This should be a comma separated list of key=value pairs.'
required: false
release-notes:
description: 'Release notes to include when publishing the app. This is used for platforms that support release notes, such as Firebase App Distribution and Google Play Store.'
required: false
# Apple Publish step inputs
apple-api-key-id:
description: 'Apple API key ID. Required for publishing to App Store Connect.'
required: false
apple-api-key-content:
description: 'Apple API key content. Required for publishing to App Store Connect.'
required: false
apple-api-key-issuer-id:
description: 'Apple API key issuer ID. Required for publishing to App Store Connect.'
required: false
# iOS Build & Publish step inputs
ios-distribution-certificate-base64:
description: 'Base64 encoded P12 file containing the iOS distribution certificate and private key. Required for building and signing iOS apps.'
required: false
ios-distribution-certificate-password:
description: 'Password for the iOS distribution certificate. Required for building and signing iOS apps.'
required: false
ios-provisioning-profile-base64:
description: 'Base64 encoded provisioning profile for iOS. Required for building and signing iOS apps.'
required: false
ios-export-options-plist:
description: 'Path to export options plist file for iOS.'
required: false
# macOS Build & Publish step inputs
macos-distribution-certificate-base64:
description: 'Base64 encoded P12 file containing the macOS distribution certificate and private key. Required for building and signing macOS apps.'
required: false
macos-distribution-certificate-password:
description: 'Password for the macOS distribution certificate. Required for building and signing macOS apps.'
required: false
macos-installer-certificate-base64:
description: 'Base64 encoded P12 file containing the macOS installer certificate and private key. Required for building and signing macOS apps.'
required: false
macos-installer-certificate-password:
description: 'Password for the macOS installer certificate. Required for building and signing macOS apps.'
required: false
macos-provisioning-profile-base64:
description: 'Base64 encoded provisioning profile for macOS. Required for building and signing macOS apps.'
required: false
# Snap Build & Publish step inputs
snap-store-token:
description: 'API token for authenticating with the Snap Store. Required for publishing to the Snap Store.'
required: false
# Web Build & Publish step inputs
base-href:
description: "Overrides the href attribute of the <base> tag in web/index.html. No change is done to web/index.html file if this flag is not provided. The value has to start and end with a slash '/'. For more information: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base"
required: false
firebase-service-account-base64:
description: 'Base64 encoded Firebase service account key (JSON file). Required for publishing to Firebase Hosting.'
required: false
firebase-project-id:
description: 'Firebase project ID to publish to. Required for publishing to Firebase Hosting.'
required: false
firebase-app-distribution-app-id:
description: 'Firebase App ID to publish to. Required for publishing to Firebase App Distribution.'
required: false
firebase-app-distribution-groups:
description: 'Comma separated list of tester groups to distribute the app to. Required for publishing to Firebase App Distribution.'
required: false
firebase-hosting-target:
description: 'Target to publish to. Required for publishing to Firebase Hosting.'
required: false
# Android Build step inputs
android-store-file-base64:
description: 'Base64 encoded JKS or PKCS12 file containing the Android signing keystore. Required for building and signing Android apps.'
required: false
android-key-alias:
description: 'Alias of the key to use from the Android signing keystore. Required for building and signing Android apps.'
required: false
android-store-password:
description: 'Password for the Android signing keystore. Required for building and signing Android apps.'
required: false
android-key-password:
description: 'Password for the key to use from the Android signing keystore. Required for building and signing Android apps.'
required: false
play-store-service-account-json:
description: 'JSON file content for the Google Play Store service account. Required for publishing to Google Play Store.'
required: false
play-store-track:
description: 'The track to publish the app to (e.g. alpha, beta, production)'
required: false
play-store-status:
description: 'The status of the release (e.g. completed, draft, halted, inProgress)'
required: false
default: 'completed'
play-store-package-name:
description: 'The package name of the Android app. Required for publishing to Google Play Store.'
required: false
# Windows Build step inputs
microsoft-partner-center-tenant-id:
description: 'Microsoft Partner Center tenant ID. Required for publishing to Microsoft Store.'
required: false
microsoft-store-app-id:
description: 'Microsoft Store app ID. Required for publishing to Microsoft Store.'
required: false
microsoft-partner-center-seller-id:
description: 'Microsoft Partner Center seller ID. Required for publishing to Microsoft Store.'
required: false
microsoft-partner-center-client-id:
description: 'Microsoft Partner Center client ID. Required for publishing to Microsoft Store.'
required: false
microsoft-partner-center-client-secret:
description: 'Microsoft Partner Center client secret. Required for publishing to Microsoft Store.'
required: false
runs:
using: 'composite'
steps:
# -- Check inputs -----------------------------------------------------
- name: Validate inputs
shell: bash
run: |
ERRORS=()
PLATFORM="${{ inputs.build-platforms }}"
DESTINATION="${{ inputs.publish-destinations }}"
BUILD_MODE="${{ inputs.build-mode }}"
# --- Firebase Hosting: only web is supported ---
if [[ "$DESTINATION" == *"firebase-hosting"* ]]; then
if [[ "$PLATFORM" != *"web"* ]]; then
ERRORS+=("Firebase Hosting only supports the 'web' platform. Got: '$PLATFORM'.")
fi
if [ "${{ inputs.firebase-project-id }}" == "" ]; then
ERRORS+=("'firebase-project-id' is required when publish-destinations is 'firebase-hosting'.")
fi
fi
# --- Firebase App Distribution: web, windows, macos and linux are not supported ---
if [[ "$DESTINATION" == *"firebase-app-distribution"* ]]; then
if [[ "$PLATFORM" == *"web"* ]] || [[ "$PLATFORM" == *"linux"* ]] || [[ "$PLATFORM" == *"windows"* ]] || [[ "$PLATFORM" == *"macos"* ]]; then
ERRORS+=("Firebase App Distribution does not support the '$PLATFORM' platform.")
fi
if [ -z "${{ inputs.firebase-service-account-base64 }}" ]; then
ERRORS+=("'firebase-service-account-base64' is required when publish-destinations is 'firebase-app-distribution'.")
fi
fi
# --- Android: signing inputs required for release and profile builds ---
if [[ "$PLATFORM" == *"android"* ]] && [ "$BUILD_MODE" != "debug" ]; then
if [ -z "${{ inputs.android-store-file-base64 }}" ]; then
ERRORS+=("'android-store-file-base64' is required when building Android in '$BUILD_MODE' mode.")
fi
if [ -z "${{ inputs.android-key-alias }}" ]; then
ERRORS+=("'android-key-alias' is required when building Android in '$BUILD_MODE' mode.")
fi
if [ -z "${{ inputs.android-store-password }}" ]; then
ERRORS+=("'android-store-password' is required when building Android in '$BUILD_MODE' mode.")
fi
if [ -z "${{ inputs.android-key-password }}" ]; then
ERRORS+=("'android-key-password' is required when building Android in '$BUILD_MODE' mode.")
fi
fi
# --- iOS: signing certificate required ---
if [[ "$PLATFORM" == *"ios"* ]]; then
if [ -z "${{ inputs.ios-distribution-certificate-base64 }}" ]; then
ERRORS+=("'ios-distribution-certificate-base64' is required when building for iOS.")
fi
fi
# --- License check: config path required ---
if [ "${{ inputs.run-license-check }}" = "true" ]; then
if [ -z "${{ inputs.licenses-conf-path }}" ]; then
ERRORS+=("'licenses-conf-path' is required when 'run-license-check' is true.")
fi
fi
# --- Runner OS compatibility ---
RUNNER_OS="${{ runner.os }}"
if [[ "$PLATFORM" == *"ios"* ]] && [ "$RUNNER_OS" != "macOS" ]; then
ERRORS+=("Building for 'ios' requires a macOS runner. Current runner OS: '$RUNNER_OS'.")
fi
if [[ "$PLATFORM" == *"macos"* ]] && [ "$RUNNER_OS" != "macOS" ]; then
ERRORS+=("Building for 'macos' requires a macOS runner. Current runner OS: '$RUNNER_OS'.")
fi
if [[ "$PLATFORM" == *"windows"* ]] && [ "$RUNNER_OS" != "Windows" ]; then
ERRORS+=("Building for 'windows' requires a Windows runner. Current runner OS: '$RUNNER_OS'.")
fi
if [[ "$PLATFORM" == *"linux"* ]] && [ "$RUNNER_OS" != "Linux" ]; then
ERRORS+=("Building for 'linux' requires a Linux runner. Current runner OS: '$RUNNER_OS'.")
fi
# --- Report all errors ---
if [ ${#ERRORS[@]} -gt 0 ]; then
for ERROR in "${ERRORS[@]}"; do
echo "🚨 ::error:: $ERROR"
done
exit 1
fi
echo "✅ Input validation passed."
# -- Setup Flutter -----------------------------------------------------
- name: Check Flutter installed
id: check-flutter
if: >-
inputs.build-platforms != '' ||
inputs.run-build-runner == 'true' ||
inputs.run-gen-l10n == 'true' ||
inputs.run-analyze == 'true' ||
inputs.run-license-check == 'true' ||
inputs.run-test == 'true'
shell: bash
run: |
if command -v flutter &>/dev/null; then
echo "installed=true" >> "$GITHUB_OUTPUT"
echo "☑️ Flutter already installed: $(flutter --version 2>&1 | head -1)"
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup Flutter
if: steps.check-flutter.conclusion == 'success' && steps.check-flutter.outputs.installed != 'true'
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}
channel: ${{ inputs.flutter-channel }}
cache: true
# -- Prepare -----------------------------------------------------
- name: Get dependencies
shell: bash
run:
flutter pub get
- name: Run Build Runner
shell: bash
if: ${{ inputs.run-build-runner == 'true' }}
run: |
chmod +x $GITHUB_ACTION_PATH/prepare/build_runner/build_runner.sh
$GITHUB_ACTION_PATH/prepare/build_runner/build_runner.sh
- name: Run gen-l10n
shell: bash
if: ${{ inputs.run-gen-l10n == 'true' }}
run: |
chmod +x $GITHUB_ACTION_PATH/prepare/gen-l10n/gen-l10n.sh
$GITHUB_ACTION_PATH/prepare/gen-l10n/gen-l10n.sh
env:
FAILS_IF_UNTRANSLATED: ${{ inputs.gen-l10n-fails-if-untranslated }}
# -- Check -----------------------------------------------------
- name: Run Analyze
if: ${{ inputs.run-analyze == 'true' }}
env:
ANALYZE_FAILS_IF_INFOS: ${{ inputs.analyze-fails-if-infos }}
ANALYZE_FAILS_IF_WARNINGS: ${{ inputs.analyze-fails-if-warnings }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/check/analyze/analyze.sh
$GITHUB_ACTION_PATH/check/analyze/analyze.sh
- name: Check Licenses
if: ${{ inputs.run-license-check == 'true' }}
env:
COMPATIBLE_LICENSES_CONF_PATH: ${{ inputs.licenses-conf-path }}
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/check/license/license.sh
$GITHUB_ACTION_PATH/check/license/license.sh
- name: Run Tests
if: ${{ inputs.run-test == 'true' }}
env:
DART_DEFINE: ${{ inputs.dart-define }}
FLAVOR: ${{ inputs.flavor }}
CONCURRENCY: ${{ inputs.test-concurrency }}
TIMEOUT: ${{ inputs.test-timeout }}
IGNORE_TIMEOUTS: ${{ inputs.test-ignore-timeouts }}
RUN_COVERAGE: ${{ inputs.test-run-coverage }}
CREATE_COVERAGE_REPORT: ${{ inputs.test-create-coverage-report }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/check/test/test.sh
$GITHUB_ACTION_PATH/check/test/test.sh
# -- Build --------------------------------------------------------------
- name: Build android
id: build-android-apk
if: contains(inputs.build-platforms, 'android-apk')
env:
ANDROID_STORE_FILE_BASE64: ${{ inputs.android-store-file-base64 }}
ANDROID_STORE_PASSWORD: ${{ inputs.android-store-password }}
ANDROID_KEY_PASSWORD: ${{ inputs.android-key-password }}
ANDROID_KEY_ALIAS: ${{ inputs.android-key-alias }}
FLAVOR: ${{ inputs.flavor }}
DART_DEFINE: ${{ inputs.dart-define }}
BUILD_TYPE: apk
BUILD_MODE: ${{ inputs.build-mode }}
BUILD_NAME: ${{ inputs.build-name }}
BUILD_NUMBER: ${{ inputs.build-number }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/android/android.sh
$GITHUB_ACTION_PATH/build/android/android.sh
- name: Build android
id: build-android-appbundle
if: contains(inputs.build-platforms, 'android-appbundle')
env:
ANDROID_STORE_FILE_BASE64: ${{ inputs.android-store-file-base64 }}
ANDROID_STORE_PASSWORD: ${{ inputs.android-store-password }}
ANDROID_KEY_PASSWORD: ${{ inputs.android-key-password }}
ANDROID_KEY_ALIAS: ${{ inputs.android-key-alias }}
FLAVOR: ${{ inputs.flavor }}
DART_DEFINE: ${{ inputs.dart-define }}
BUILD_TYPE: appbundle
BUILD_MODE: ${{ inputs.build-mode }}
BUILD_NAME: ${{ inputs.build-name }}
BUILD_NUMBER: ${{ inputs.build-number }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/android/android.sh
$GITHUB_ACTION_PATH/build/android/android.sh
- name: Build iOS
id: build-ios
if: contains(inputs.build-platforms, 'ios')
env:
IOS_DISTRIBUTION_CERTIFICATE_BASE64: ${{ inputs.ios-distribution-certificate-base64 }}
IOS_DISTRIBUTION_CERTIFICATE_PASSWORD: ${{ inputs.ios-distribution-certificate-password }}
IOS_PROVISIONING_PROFILE_BASE64: ${{ inputs.ios-provisioning-profile-base64 }}
EXPORT_OPTIONS_PLIST: ${{ inputs.ios-export-options-plist }}
BUILD_MODE: ${{ inputs.build-mode }}
FLAVOR: ${{ inputs.flavor }}
DART_DEFINE: ${{ inputs.dart-define }}
BUILD_NUMBER: ${{ inputs.build-number }}
BUILD_NAME: ${{ inputs.build-name }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/ios/ios.sh
$GITHUB_ACTION_PATH/build/ios/ios.sh
- name: Build web
id: build-web
if: contains(inputs.build-platforms, 'web')
env:
BUILD_MODE: ${{ inputs.build-mode }}
DART_DEFINE: ${{ inputs.dart-define }}
BUILD_NUMBER: ${{ inputs.build-number }}
BUILD_NAME: ${{ inputs.build-name }}
BASE_HREF: ${{ inputs.base-href }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/web/web.sh
$GITHUB_ACTION_PATH/build/web/web.sh
- name: Build windows
id: build-windows
if: contains(inputs.build-platforms, 'windows')
env:
BUILD_MODE: ${{ inputs.build-mode }}
BUILD_NAME: ${{ inputs.build-name }}
BUILD_NUMBER: ${{ inputs.build-number }}
DART_DEFINE: ${{ inputs.dart-define }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/windows/windows.sh
$GITHUB_ACTION_PATH/build/windows/windows.sh
- name: Build macos
id: build-macos
if: contains(inputs.build-platforms, 'macos')
env:
MACOS_DISTRIBUTION_CERTIFICATE_BASE64: ${{ inputs.macos-distribution-certificate-base64 }}
MACOS_DISTRIBUTION_CERTIFICATE_PASSWORD: ${{ inputs.macos-distribution-certificate-password }}
MACOS_INSTALLER_CERTIFICATE_BASE64: ${{ inputs.macos-installer-certificate-base64 }}
MACOS_INSTALLER_CERTIFICATE_PASSWORD: ${{ inputs.macos-installer-certificate-password }}
MACOS_PROVISIONING_PROFILE_BASE64: ${{ inputs.macos-provisioning-profile-base64 }}
BUILD_MODE: ${{ inputs.build-mode }}
FLAVOR: ${{ inputs.flavor }}
DART_DEFINE: ${{ inputs.dart-define }}
BUILD_NUMBER: ${{ inputs.build-number }}
BUILD_NAME: ${{ inputs.build-name }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/macos/macos.sh
$GITHUB_ACTION_PATH/build/macos/macos.sh
- name: Build linux
id: build-linux
if: contains(inputs.build-platforms, 'linux')
env:
BUILD_MODE: ${{ inputs.build-mode }}
BUILD_NAME: ${{ inputs.build-name }}
BUILD_NUMBER: ${{ inputs.build-number }}
DART_DEFINE: ${{ inputs.dart-define }}
NO_PUB: 'true'
shell: bash
run: |
chmod +x $GITHUB_ACTION_PATH/build/linux/linux.sh
$GITHUB_ACTION_PATH/build/linux/linux.sh
# -- Publish Github ------------------------------------------------------------
- name: Setup Pages
if: contains(inputs.publish-destinations, 'github-pages') && contains(inputs.build-platforms, 'web')
uses: actions/configure-pages@v6
with:
enablement: true
- name: Upload artifact for GitHub Pages
if: contains(inputs.publish-destinations, 'github-pages') && contains(inputs.build-platforms, 'web')
uses: actions/upload-pages-artifact@v4
with:
path: ${{ steps.build-web.outputs.artifact-path }}
name: web-build
- name: Deploy to GitHub Pages
if: contains(inputs.publish-destinations, 'github-pages') && contains(inputs.build-platforms, 'web')
uses: actions/deploy-pages@v5
with:
artifact_name: web-build
# -- Publish to firebase ------------------------------------------------------------
- name: Publish iOS to Firebase App Distribution
if: contains(inputs.publish-destinations, 'firebase-app-distribution') && contains(inputs.build-platforms, 'ios')
uses: Spaccesi/flutter-ci-suite/publish/firebase-app-distribution@main
with:
firebase-release-binary-file: ${{ steps.build-ios.outputs.artifact-path }}
firebase-service-account-base64: ${{ inputs.firebase-service-account-base64 }}
firebase-app-id: ${{ inputs.firebase-app-distribution-app-id }}
firebase-groups: ${{ inputs.firebase-app-distribution-groups }}
firebase-release-notes: ${{ inputs.release-notes }}
- name: Publish android to Firebase App Distribution (APK)
if: contains(inputs.publish-destinations, 'firebase-app-distribution') && contains(inputs.build-platforms, 'android-apk')
uses: Spaccesi/flutter-ci-suite/publish/firebase-app-distribution@main
with:
firebase-service-account-base64: ${{ inputs.firebase-service-account-base64 }}
firebase-release-binary-file: ${{ steps.build-android-apk.outputs.artifact-path }}
firebase-app-id: ${{ inputs.firebase-app-distribution-app-id }}
firebase-groups: ${{ inputs.firebase-app-distribution-groups }}
firebase-release-notes: ${{ inputs.release-notes }}
- name: Publish android to Firebase App Distribution (App Bundle)
if: contains(inputs.publish-destinations, 'firebase-app-distribution') && contains(inputs.build-platforms, 'android-appbundle')
uses: Spaccesi/flutter-ci-suite/publish/firebase-app-distribution@main
with:
firebase-service-account-base64: ${{ inputs.firebase-service-account-base64 }}
firebase-release-binary-file: ${{ steps.build-android-appbundle.outputs.artifact-path }}
firebase-app-id: ${{ inputs.firebase-app-distribution-app-id }}
firebase-groups: ${{ inputs.firebase-app-distribution-groups }}
firebase-release-notes: ${{ inputs.release-notes }}
- name: Publish to Firebase Hosting
if: contains(inputs.publish-destinations, 'firebase-hosting') && contains(inputs.build-platforms, 'web')
uses: Spaccesi/flutter-ci-suite/publish/firebase-hosting@main
with:
firebase-service-account-base64: ${{ inputs.firebase-service-account-base64 }}
firebase-target: ${{ inputs.firebase-hosting-target }}
firebase-project-id: ${{ inputs.firebase-project-id }}
# -- Publish to stores ------------------------------------------------------------
- name: Deploy to Play Store
if: contains(inputs.publish-destinations, 'play-store') && contains(inputs.build-platforms, 'android-apk')
uses: Spaccesi/flutter-ci-suite/publish/play-store@main
with:
play-store-package-name: ${{ inputs.play-store-package-name }}
play-store-track: ${{ inputs.play-store-track }}
play-store-service-account-json: ${{ inputs.play-store-service-account-json }}
play-store-release-files: ${{ steps.build-android-apk.outputs.artifact-path }}
- name: Deploy to Play Store
if: contains(inputs.publish-destinations, 'play-store') && contains(inputs.build-platforms, 'android-appbundle')
uses: Spaccesi/flutter-ci-suite/publish/play-store@main
with:
play-store-package-name: ${{ inputs.play-store-package-name }}
play-store-track: ${{ inputs.play-store-track }}
play-store-service-account-json: ${{ inputs.play-store-service-account-json }}
play-store-release-files: ${{ steps.build-android-appbundle.outputs.artifact-path }}
- name: Deploy to ios App Store
if: contains(inputs.publish-destinations, 'ios-app-store') && contains(inputs.build-platforms, 'ios')
uses: Spaccesi/flutter-ci-suite/publish/ios-app-store@main
with:
apple-api-key-id: ${{ inputs.apple-api-key-id }}
apple-api-key-content: ${{ inputs.apple-api-key-content }}
apple-api-key-issuer-id: ${{ inputs.apple-api-key-issuer-id }}
ios-app-path: ${{ steps.build-ios.outputs.artifact-path }}
- name: Deploy to Microsoft Store
if: contains(inputs.publish-destinations, 'microsoft-store') && contains(inputs.build-platforms, 'windows')
uses: Spaccesi/flutter-ci-suite/publish/microsoft-store@main
with:
microsoft-partner-center-tenant-id: ${{ inputs.microsoft-partner-center-tenant-id }}
microsoft-partner-center-seller-id: ${{ inputs.microsoft-partner-center-seller-id }}
microsoft-partner-center-client-id: ${{ inputs.microsoft-partner-center-client-id }}
microsoft-partner-center-client-secret: ${{ inputs.microsoft-partner-center-client-secret }}
microsoft-store-app-id: ${{ inputs.microsoft-store-app-id }}
- name: Deploy to Mac App Store
if: contains(inputs.publish-destinations, 'macos-app-store') && contains(inputs.build-platforms, 'macos')
uses: Spaccesi/flutter-ci-suite/publish/macos-app-store@main
with:
apple-api-key-id: ${{ inputs.apple-api-key-id }}
apple-api-key-issuer-id: ${{ inputs.apple-api-key-issuer-id }}
apple-api-key-content: ${{ inputs.apple-api-key-content }}
macos-app-path: ${{ steps.build-macos.outputs.artifact-path }}
- name: Deploy to Linux Snap App Store
if: contains(inputs.publish-destinations, 'snap-store') && contains(inputs.build-platforms, 'linux')
uses: Spaccesi/flutter-ci-suite/publish/snap-store@main
with:
snap-store-token: ${{ inputs.snap-store-token }}