115 lines
3.4 KiB
YAML
115 lines
3.4 KiB
YAML
# Codemagic builds for Nanga Kathai. Setup steps: docs/app-store-release.md
|
|
#
|
|
# Needed in Codemagic (Team settings / app settings):
|
|
# - Environment variable group "nk_app": SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, MEDIA_BASE_URL
|
|
# - App Store Connect API key integration named "NK App Store Connect" (iOS)
|
|
# - Variable CERTIFICATE_PRIVATE_KEY (secure) in group "nk_ios_signing" (iOS signing)
|
|
# - Android keystore uploaded with reference name "nk_upload_keystore" (Android)
|
|
# - Variable GCLOUD_SERVICE_ACCOUNT_CREDENTIALS in group "nk_google_play" (Android publishing)
|
|
|
|
definitions:
|
|
write_env: &write_env
|
|
name: Write env.json from Codemagic variables
|
|
script: |
|
|
cat > env.json <<EOF
|
|
{
|
|
"SUPABASE_URL": "$SUPABASE_URL",
|
|
"SUPABASE_PUBLISHABLE_KEY": "$SUPABASE_PUBLISHABLE_KEY",
|
|
"MEDIA_BASE_URL": "$MEDIA_BASE_URL"
|
|
}
|
|
EOF
|
|
checks: &checks
|
|
name: Analyze and test
|
|
script: |
|
|
flutter pub get
|
|
flutter analyze --no-fatal-infos
|
|
flutter test
|
|
email: &email
|
|
email:
|
|
recipients:
|
|
- info@metatroncubesolutions.com
|
|
notify:
|
|
success: true
|
|
failure: true
|
|
|
|
workflows:
|
|
ios-release:
|
|
name: iOS release (TestFlight)
|
|
instance_type: mac_mini_m2
|
|
max_build_duration: 60
|
|
integrations:
|
|
app_store_connect: NK App Store Connect
|
|
environment:
|
|
groups:
|
|
- nk_app
|
|
- nk_ios_signing # CERTIFICATE_PRIVATE_KEY (secure)
|
|
vars:
|
|
BUNDLE_ID: com.metatroncubesolutions.nangaKathai
|
|
flutter: stable
|
|
xcode: latest
|
|
cocoapods: default
|
|
triggering:
|
|
events:
|
|
- tag
|
|
tag_patterns:
|
|
- pattern: 'v*'
|
|
scripts:
|
|
- *write_env
|
|
- *checks
|
|
# Fetches the Apple Distribution certificate and App Store profile through the API key,
|
|
# creating them on the first run. CERTIFICATE_PRIVATE_KEY is the certificate's key.
|
|
- name: Set up App Store code signing
|
|
script: |
|
|
keychain initialize
|
|
app-store-connect fetch-signing-files "$BUNDLE_ID" --type IOS_APP_STORE --create
|
|
keychain add-certificates
|
|
xcode-project use-profiles
|
|
- name: Build the iOS app
|
|
script: |
|
|
flutter build ipa --release \
|
|
--build-number=$BUILD_NUMBER \
|
|
--dart-define-from-file=env.json \
|
|
--export-options-plist=/Users/builder/export_options.plist
|
|
artifacts:
|
|
- build/ios/ipa/*.ipa
|
|
- /tmp/xcodebuild_logs/*.log
|
|
publishing:
|
|
<<: *email
|
|
app_store_connect:
|
|
auth: integration
|
|
submit_to_testflight: true
|
|
|
|
android-release:
|
|
name: Android release (Play internal testing)
|
|
instance_type: linux_x2
|
|
max_build_duration: 45
|
|
environment:
|
|
groups:
|
|
- nk_app
|
|
- nk_google_play
|
|
flutter: stable
|
|
android_signing:
|
|
- nk_upload_keystore
|
|
triggering:
|
|
events:
|
|
- tag
|
|
tag_patterns:
|
|
- pattern: 'v*'
|
|
scripts:
|
|
- *write_env
|
|
- *checks
|
|
- name: Build the Android app bundle
|
|
script: |
|
|
flutter build appbundle --release \
|
|
--build-number=$((BUILD_NUMBER + 1)) \
|
|
--dart-define-from-file=env.json
|
|
artifacts:
|
|
- build/app/outputs/bundle/release/*.aab
|
|
- build/app/outputs/mapping/release/mapping.txt
|
|
publishing:
|
|
<<: *email
|
|
google_play:
|
|
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
|
|
track: internal
|
|
submit_as_draft: true
|