-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodemagic.yaml
91 lines (88 loc) · 4.86 KB
/
codemagic.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
workflows:
ios-sign:
name: Signing iOS
working_directory: myapp
environment:
flutter: stable # Define the channel name or version (e.g. v1.13.4)
xcode: latest
groups:
- ios
scripts:
- name: Set up keychain to be used for code signing using Codemagic CLI 'keychain' command
script: keychain initialize
- name: Fetch signing files
script: app-store-connect fetch-signing-files "$(xcode-project detect-bundle-id)" --type IOS_APP_STORE --create
- name: Set up signing certificate
script: keychain add-certificates
- name: Set up code signing settings on Xcode project
script: xcode-project use-profiles
- name: Get Flutter packages
script: cd . && flutter packages pub get
- name: Flutter rm podfile.lock
script: cd ios && rm -rf Pods/ Podfile.lock
- name: Flutter build ipa and automatic versioning
script: |
flutter build ipa --release \
--build-name=1.0.0 \
--build-number=$(($(app-store-connect get-latest-testflight-build-number "$APP_STORE_ID") + 1)) \
--export-options-plist=/Users/builder/export_options.plist
artifacts:
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- flutter_drive.log
publishing:
app_store_connect: # For iOS or macOS app
# For authenticating with App Store Connect and uploading the IPA to App Store Connect (required)
api_key: $APP_STORE_CONNECT_PRIVATE_KEY # Contents of the API key saved as a secure environment variable
key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER # Alphanumeric value that identifies the API key, can also reference environment variable such as $APP_STORE_CONNECT_KEY_IDENTIFIER
issuer_id: $APP_STORE_CONNECT_ISSUER_ID # Alphanumeric value that identifies who created the API key, can also reference environment variable such as $APP_STORE_CONNECT_ISSUER_ID
# Configuration related to TestFlight (optional)
submit_to_testflight: true # Optional boolean, defaults to false. Whether or not to submit the uploaded build to TestFlight beta review. Required for distributing to beta groups. Note: This action is performed during post-processing.
beta_groups: # Specify the names of beta tester groups that will get access to the build once it has passed beta review.
- App Store Connect Users
# Configuration related to App Store (optional)
submit_to_app_store: true # Optional boolean, defaults to false. Whether or not to submit the uploaded build to App Store review. Note: This action is performed during post-processing.
release_type: SCHEDULED # Optional, defaults to MANUAL. Supported values: MANUAL, AFTER_APPROVAL or SCHEDULED
android-workflow:
name: Android Workflow
max_build_duration: 120
environment:
groups:
- production
# Add the above group environment variables in Codemagic UI (either in Application/Team variables) - https://docs.codemagic.io/variables/environment-variable-groups/
vars:
PACKAGE_NAME: 'com.example.myapp' # <-- Put your package name here e.g. "io.codemagic.flutteryaml"
GOOGLE_PLAY_TRACK: 'alpha' # <-- Any default or custom track that is not in ‘draft’ status
flutter: stable
xcode: latest
cocoapods: default
scripts:
- name: Set up key properties
script: keytool -genkeypair -alias androiddebugkey -keypass android -keystore ~/.android/debug.keystore -storepass android -dname 'CN=Android Debug,O=Android,C=US' -keyalg 'RSA' -keysize 2048 -validity 10000
- name: Get Flutter packages
script: |
cd my_app && flutter packages pub get
- name: Flutter analyze
script: |
cd my_app && flutter analyze
- name: Flutter unit tests
script: |
cd my_app && flutter test
ignore_failure: true
- name: Build APK with Flutter
script: |
cd my_app && flutter build apk --release --build-name=1.0.0 --build-number=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks="$GOOGLE_PLAY_TRACK") + 1))
artifacts:
- build/**/outputs/bundle/**/*.aab
- build/**/outputs/apk/**/*.apk
- build/**/outputs/**/mapping.txt
- flutter_drive.log
publishing:
# See the following link for details about email publishing - https://docs.codemagic.io/publishing-yaml/distribution/#email
email:
recipients:
notify:
success: true # To receive a notification when a build succeeds
failure: false # To not receive a notification when a build fails