diff --git a/codemagic.yaml b/codemagic.yaml index f75718fc..0baef74f 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -2,29 +2,37 @@ client-app-android-apk-build-script: &client-app-android-apk-build-script name: 👷🤖 Build Client App APK (Android) script: | - make -C ../.. mobile-client-build ENV=$ENV PLATFORM=android BUILD_TYPE=apk + make mobile-client-build PLATFORM=apk client-app-ios-build-script: &client-app-ios-build-script name: 👷🍎 Build Client App (iOS) script: | - make -C ../.. mobile-client-build ENV=$ENV PLATFORM=ios + make mobile-client-build PLATFORM=ios staff-app-android-apk-build-script: &staff-app-android-apk-build-script name: 👷🤖 Build Staff App APK (Android) script: | - make -C ../.. mobile-staff-build ENV=$ENV PLATFORM=android BUILD_TYPE=apk + make mobile-staff-build PLATFORM=apk staff-app-ios-build-script: &staff-app-ios-build-script name: 👷🍎 Build Staff App (iOS) script: | - make -C ../.. mobile-staff-build ENV=$ENV PLATFORM=ios + make mobile-staff-build PLATFORM=ios # Reusable script for distributing Android to Firebase distribute-android-script: &distribute-android-script name: 🚛🤖 Distribute Android to Firebase App Distribution script: | # Distribute Android APK - firebase appdistribution:distribute "build/app/outputs/flutter-apk/app-${ENV}-release.apk" \ + # Note: Using wildcards to catch app-release.apk + APP_PATH=$(find apps/mobile/apps -name "app-release.apk" | head -n 1) + if [ -z "$APP_PATH" ]; then + echo "No APK found!" + exit 1 + fi + echo "Found APK at: $APP_PATH" + + firebase appdistribution:distribute "$APP_PATH" \ --app $FIREBASE_APP_ID_ANDROID \ --release-notes "Build $FCI_BUILD_NUMBER - Environment: $ENV" \ --groups "$FIREBASE_TESTER_GROUPS" \ @@ -35,7 +43,14 @@ distribute-ios-script: &distribute-ios-script name: 🚛🍎 Distribute iOS to Firebase App Distribution script: | # Distribute iOS - firebase appdistribution:distribute "build/ios/ipa/app.ipa" \ + IPA_PATH=$(find apps/mobile/apps -name "*.ipa" | head -n 1) + if [ -z "$IPA_PATH" ]; then + echo "No IPA found!" + exit 1 + fi + echo "Found IPA at: $IPA_PATH" + + firebase appdistribution:distribute "$IPA_PATH" \ --app $FIREBASE_APP_ID_IOS \ --release-notes "Build $FCI_BUILD_NUMBER - Environment: $ENV" \ --groups "$FIREBASE_TESTER_GROUPS" \ @@ -47,36 +62,48 @@ workflows: # ================================================================================= client-app-base: &client-app-base name: Client App Base - working_directory: apps/mobile-client + working_directory: . instance_type: mac_mini_m2 max_build_duration: 60 environment: flutter: stable xcode: latest cocoapods: default + artifacts: + - apps/mobile/apps/client/build/app/outputs/flutter-apk/*.apk + - apps/mobile/apps/client/build/ios/ipa/*.ipa + - apps/mobile/apps/client/build/app/outputs/bundle/release/app-release.aab + - /tmp/xcodebuild_logs/*.log + - flutter_drive.log cache: cache_paths: - $HOME/.pub-cache - - $FCI_BUILD_DIR/apps/mobile-client/build - - $FCI_BUILD_DIR/apps/mobile-client/.dart_tool + - $FCI_BUILD_DIR/apps/mobile/apps/client/build + - $FCI_BUILD_DIR/apps/mobile/apps/client/.dart_tool # ================================================================================= # Base workflow for staff_app # ================================================================================= staff-app-base: &staff-app-base name: Staff App Base - working_directory: apps/mobile-staff + working_directory: . instance_type: mac_mini_m2 max_build_duration: 60 environment: flutter: stable xcode: latest cocoapods: default + artifacts: + - apps/mobile/apps/staff/build/app/outputs/flutter-apk/*.apk + - apps/mobile/apps/staff/build/ios/ipa/*.ipa + - apps/mobile/apps/staff/build/app/outputs/bundle/release/app-release.aab + - /tmp/xcodebuild_logs/*.log + - flutter_drive.log cache: cache_paths: - $HOME/.pub-cache - - $FCI_BUILD_DIR/apps/mobile-staff/build - - $FCI_BUILD_DIR/apps/mobile-staff/.dart_tool + - $FCI_BUILD_DIR/apps/mobile/apps/staff/build + - $FCI_BUILD_DIR/apps/mobile/apps/staff/.dart_tool # ================================================================================= # Client App Workflows - Android