135 lines
4.3 KiB
YAML
135 lines
4.3 KiB
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
|
|
# =================================================================================
|
|
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:
|
|
- *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:
|
|
- *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:
|
|
- *build-script
|
|
- *distribute-script
|
|
|
|
# =================================================================================
|
|
# Staff App Workflows
|
|
# =================================================================================
|
|
staff-app-dev:
|
|
<<: *staff-app-base
|
|
name: Staff App Dev
|
|
environment:
|
|
groups:
|
|
- staff_app_dev_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *build-script
|
|
- *distribute-script
|
|
|
|
staff-app-staging:
|
|
<<: *staff-app-base
|
|
name: Staff App Staging
|
|
environment:
|
|
groups:
|
|
- staff_app_staging_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *build-script
|
|
- *distribute-script
|
|
|
|
staff-app-prod:
|
|
<<: *staff-app-base
|
|
name: Staff App Prod
|
|
environment:
|
|
groups:
|
|
- staff_app_prod_credentials # Codemagic Environment Variable Group
|
|
scripts:
|
|
- *build-script
|
|
- *distribute-script |