-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
51 lines (51 loc) · 1.91 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
workflows:
android-kmm-workflow:
name: Politer AI Android Kotlin multiplatform workflow to publish app bundle to Google Play
max_build_duration: 120
environment:
vars:
PACKAGE_NAME: "com.turskyi.politerai"
JAVA_HOME: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home # Path to Java 17
android_signing:
- politerai_android_keystore_reference
groups:
- google_play_credentials # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS - google-services.json here)
triggering:
events:
- push
branch_patterns:
- pattern: master
include: true
source: true
scripts:
- name: Generate key.properties file
script: |
echo $KEY_PROPERTIES | base64 --decode > $FCI_BUILD_DIR/key.properties
- name: Build Android release
script: |
LATEST_GOOGLE_PLAY_BUILD_NUMBER=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME")
if [ -z $LATEST_GOOGLE_PLAY_BUILD_NUMBER ]; then
# fallback in case no build number was found from Google Play.
# Alternatively, you can `exit 1` to fail the build
# BUILD_NUMBER is a Codemagic built-in variable tracking the number
# of times this workflow has been built
UPDATED_BUILD_NUMBER=$BUILD_NUMBER
else
UPDATED_BUILD_NUMBER=$(($LATEST_GOOGLE_PLAY_BUILD_NUMBER + 1))
fi
cd $CM_BUILD_DIR/androidApp
./gradlew bundleRelease \
-PversionCode=$UPDATED_BUILD_NUMBER \
-PversionName=1.0.$UPDATED_BUILD_NUMBER
artifacts:
- composeApp/build/outputs/**/**/*.aab
publishing:
email:
recipients:
- dmytro@turskyi.com
notify:
success: true
failure: true
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: production