146 lines
4.6 KiB
YAML
146 lines
4.6 KiB
YAML
# Reusable script for building the Flutter app
|
|
flutter-build-script: &flutter-build-script
|
|
name: 👷 Build Flutter App
|
|
script: |
|
|
flutter pub get
|
|
flutter pub run build_runner build --delete-conflicting-outputs
|
|
|
|
android-app-build-script: &android-app-build-script
|
|
name: 🤖 Build Android App
|
|
script: |
|
|
# Build Android
|
|
flutter build appbundle --flavor $FLAVOR
|
|
|
|
ios-app-build-script: &ios-app-build-script
|
|
name: 🍎 Build iOS App
|
|
script: |
|
|
# Build Android
|
|
flutter build ipa --flavor $FLAVOR
|
|
|
|
# Reusable script for distributing to Firebase
|
|
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_NUMBE R" \
|
|
--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_NUMBE R" \
|
|
--groups "$FIREBASE_TESTER_GROUPS" \
|
|
--token $FIREBASE_TOKEN
|
|
|
|
workflows:
|
|
# =================================================================================
|
|
# Base workflow for client_app
|
|
# =================================================================================
|
|
client-app-base: &client-app-base
|
|
name: Client App Base
|
|
working_directory: mobile-apps/client-app
|
|
instance_type: mac_mini_m2
|
|
max_build_duration: 60
|
|
environment:
|
|
flutter: stable
|
|
xcode: latest
|
|
cocoapods: default
|
|
cache:
|
|
cache_paths:
|
|
- $HOME/.pub-cache
|
|
- $FCI_BUILD_DIR/mobile-apps/client-app/build
|
|
- $FCI_BUILD_DIR/mobile-apps/client-app/.dart_tool
|
|
|
|
# =================================================================================
|
|
# Base workflow for staff_app
|
|
# =================================================================================
|
|
staff-app-base: &staff-app-base
|
|
name: Staff App Base
|
|
working_directory: mobile-apps/staff-app
|
|
instance_type: mac_mini_m2
|
|
max_build_duration: 60
|
|
environment:
|
|
flutter: stable
|
|
xcode: latest
|
|
cocoapods: default
|
|
cache:
|
|
cache_paths:
|
|
- $HOME/.pub-cache
|
|
- $FCI_BUILD_DIR/mobile-apps/staff-app/build
|
|
- $FCI_BUILD_DIR/mobile-apps/staff-app/.dart_tool
|
|
|
|
# =================================================================================
|
|
# Client App Workflows
|
|
# =================================================================================
|
|
client-app-dev:
|
|
<<: *client-app-base
|
|
name: Client App Dev
|
|
environment:
|
|
groups:
|
|
- client_app_dev_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *distribute-script
|
|
|
|
client-app-staging:
|
|
<<: *client-app-base
|
|
name: Client App Staging
|
|
environment:
|
|
groups:
|
|
- client_app_staging_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *distribute-script
|
|
|
|
client-app-prod:
|
|
<<: *client-app-base
|
|
name: Client App Prod
|
|
environment:
|
|
groups:
|
|
- client_app_prod_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *distribute-script
|
|
|
|
# =================================================================================
|
|
# Staff App Workflows
|
|
# =================================================================================
|
|
staff-app-dev-app-distribute:
|
|
<<: *staff-app-base
|
|
name: 🚛👨🍳 Staff App Dev (App Distribute)
|
|
environment:
|
|
groups:
|
|
- staff_app_dev_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *android-app-build-script
|
|
- *ios-app-build-script
|
|
- *distribute-script
|
|
|
|
staff-app-staging-app-distribute:
|
|
<<: *staff-app-base
|
|
name: 🚛👨🍳 Staff App Staging (App Distribute)
|
|
environment:
|
|
groups:
|
|
- staff_app_staging_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *android-app-build-script
|
|
- *ios-app-build-script
|
|
- *distribute-script
|
|
|
|
staff-app-prod-app-distribute:
|
|
<<: *staff-app-base
|
|
name: 🚛👨🍳 Staff App Prod (App Distribute)
|
|
environment:
|
|
groups:
|
|
- staff_app_prod_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *flutter-build-script
|
|
- *android-app-build-script
|
|
- *ios-app-build-script
|
|
- *distribute-script
|