From fba12ea3b45cf482250c2bde9eed01cfed37b289 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Tue, 18 Nov 2025 11:21:07 -0500 Subject: [PATCH] feat: Enhance Codemagic scripts for improved Firebase app distribution and build processes --- codemagic.yaml | 69 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/codemagic.yaml b/codemagic.yaml index aee4a5ca..a5fe0628 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -1,5 +1,37 @@ -# codemagic.yaml workflows: + # ================================================================================= + # Reusable Scripts + # ================================================================================= + build-script: &build-script + name: Build Flutter App + script: | + flutter pub get + # Uncomment the line below if you use build_runner + # flutter pub run build_runner build --delete-conflicting-outputs + + # Build Android + flutter build appbundle --flavor $FLAVOR + + # Build iOS + flutter build ipa --flavor $FLAVOR --export-options-plist=$FCI_BUILD_DIR/mobile-apps/client-app/ios/exportOptions.plist + + distribute-script: &distribute-script + name: Distribute to Firebase App Distribution + script: | + # Distribute Android + firebase appdistribution:distribute "build/app/outputs/bundle/${FLAVOR}Release/app-${FLAVOR}-release.aab" \ + --app $FIREBASE_APP_ID_ANDROID \ + --release-notes "Build $FCI_BUILD_NUMBER" \ + --groups "$FIREBASE_TESTER_GROUPS" \ + --token $FIREBASE_TOKEN + + # Distribute iOS + firebase appdistribution:distribute "build/ios/ipa/app.ipa" \ + --app $FIREBASE_APP_ID_IOS \ + --release-notes "Build $FCI_BUILD_NUMBER" \ + --groups "$FIREBASE_TESTER_GROUPS" \ + --token $FIREBASE_TOKEN + # ================================================================================= # Base workflow for client_app # ================================================================================= @@ -100,37 +132,4 @@ workflows: - staff_app_prod_credentials # Codemagic Environment Variable Group scripts: - *build-script - - *distribute-script - - # ================================================================================= - # Reusable Scripts - # ================================================================================= - build-script: &build-script - name: Build Flutter App - script: | - flutter pub get - # Uncomment the line below if you use build_runner - # flutter pub run build_runner build --delete-conflicting-outputs - - # Build Android - flutter build appbundle --flavor $FLAVOR - - # Build iOS - flutter build ipa --flavor $FLAVOR --export-options-plist=$FCI_BUILD_DIR/mobile-apps/client-app/ios/exportOptions.plist - -distribute-script: &distribute-script - name: Distribute to Firebase App Distribution - script: | - # Distribute Android - firebase appdistribution:distribute "build/app/outputs/bundle/${FLAVOR}-release/app-${FLAVOR}-release.aab" \ - --app $FIREBASE_APP_ID_ANDROID \ - --release-notes "Build $FCI_BUILD_NUMBER" \ - --groups "$FIREBASE_TESTER_GROUPS" \ - --token $FIREBASE_TOKEN - - # Distribute iOS - firebase appdistribution:distribute "build/ios/ipa/app.ipa" \ - --app $FIREBASE_APP_ID_IOS \ - --release-notes "Build $FCI_BUILD_NUMBER" \ - --groups "$FIREBASE_TESTER_GROUPS" \ - --token $FIREBASE_TOKEN + - *distribute-script \ No newline at end of file