Skip to content

Commit

Permalink
Add codemagic.yaml for CI/CD to publish app bundle to Google Play.
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Turskyi <[email protected]>
  • Loading branch information
Turskyi committed Jan 6, 2024
1 parent 617398c commit 1c9376c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions codemagic.yaml
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

0 comments on commit 1c9376c

Please sign in to comment.