File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,10 +56,17 @@ android {
5656
5757 signingConfigs {
5858 release {
59- keyAlias keystoreProperties[' keyAlias' ]
60- keyPassword keystoreProperties[' keyPassword' ]
61- storeFile keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
62- storePassword keystoreProperties[' storePassword' ]
59+ if (System . getenv()[" CI" ]) { // CI=true is exported by Codemagic
60+ storeFile file(System . getenv()[" CM_KEYSTORE_PATH" ])
61+ storePassword System . getenv()[" CM_KEYSTORE_PASSWORD" ]
62+ keyAlias System . getenv()[" CM_KEY_ALIAS" ]
63+ keyPassword System . getenv()[" CM_KEY_PASSWORD" ]
64+ } else {
65+ keyAlias keystoreProperties[' keyAlias' ]
66+ keyPassword keystoreProperties[' keyPassword' ]
67+ storeFile keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
68+ storePassword keystoreProperties[' storePassword' ]
69+ }
6370 }
6471 }
6572
@@ -68,7 +75,7 @@ android {
6875 minifyEnabled true
6976 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
7077 shrinkResources true
71- if (keystoreProperties[' storeFile' ] != null ) {
78+ if (keystoreProperties[' storeFile' ] != null || System . getenv()[ " CI " ] ) {
7279 signingConfig signingConfigs. release
7380 } else {
7481 signingConfig signingConfigs. debug
Original file line number Diff line number Diff line change 1+ workflows :
2+ flutter-android :
3+ name : Flutter Android
4+ instance_type : mac_mini_m2
5+ max_build_duration : 120
6+ environment :
7+ android_signing :
8+ - codemagic_keystore
9+ groups :
10+ - google_play
11+ - sentry
12+ vars :
13+ PACKAGE_NAME : " com.darshan.heartry"
14+ GOOGLE_PLAY_TRACK : " beta"
15+ flutter : stable
16+ scripts :
17+ - name : Set up local.properties
18+ script : |
19+ echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
20+ - name : Get Flutter packages
21+ script : |
22+ flutter packages pub get
23+ - name : Run Flutter tests
24+ script : |
25+ flutter test
26+ - name : Setup sentry.properties
27+ script : |
28+ echo "$SENTRY_PROPERTIES" | base64 --decode > sentry.properties
29+ - name : Build AAB with Flutter
30+ script : |
31+ LATEST_BUILD_NUMBER=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks="$GOOGLE_PLAY_TRACK")))
32+ flutter build appbundle --release \
33+ --dart-define="GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" \
34+ --dart-define="SENTRY_DSN=$SENTRY_DSN"
35+ artifacts :
36+ - build/**/outputs/**/*.aab
37+ - build/**/outputs/**/mapping.txt
38+ - flutter_drive.log
39+ publishing :
40+ email :
41+ recipients :
42+ - darshandrander@outlook.com
43+ notify :
44+ success : true
45+ failure : true
46+ google_play :
47+ credentials : $GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS
48+ track : $GOOGLE_PLAY_TRACK
You can’t perform that action at this time.
0 commit comments