-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add codemagic.yaml for CI/CD to publish app bundle to Google Play.
Signed-off-by: Dmytro Turskyi <[email protected]>
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
workflows: | ||
android-workflow: | ||
name: Ethical Scanner Flutter Android Workflow to publish app bundle to Google Play. | ||
instance_type: mac_mini_m1 | ||
max_build_duration: 120 | ||
environment: | ||
android_signing: | ||
- ethical_scanner_android_keystore_reference | ||
groups: | ||
- google_play_credentials # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS – google-services.json here) | ||
vars: | ||
PACKAGE_NAME: "com.turskyi.ethical_scanner" | ||
GOOGLE_PLAY_TRACK: "production" | ||
flutter: stable | ||
scripts: | ||
- name: Set up local.properties | ||
script: | | ||
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties" | ||
- name: Get Flutter packages | ||
script: | | ||
flutter packages pub get | ||
- name: Flutter analyze | ||
script: | | ||
flutter analyze | ||
- name: Flutter unit tests | ||
script: | | ||
flutter test | ||
ignore_failure: true | ||
- name: Build AAB with Flutter | ||
script: | | ||
BUILD_NUMBER=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks="$GOOGLE_PLAY_TRACK") + 1)) | ||
flutter build appbundle --release \ | ||
--build-name=1.0.$BUILD_NUMBER \ | ||
--build-number=$BUILD_NUMBER | ||
artifacts: | ||
- build/**/outputs/**/*.aab | ||
- build/**/outputs/**/mapping.txt | ||
- flutter_drive.log | ||
publishing: | ||
email: | ||
recipients: | ||
- dmytro.turskyi.com | ||
notify: | ||
success: true | ||
failure: true | ||
google_play: | ||
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS | ||
track: $GOOGLE_PLAY_TRACK | ||
submit_as_draft: true |