-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodemagic.yaml
40 lines (40 loc) · 1.39 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
workflows:
native-android:
name: Native Android
max_build_duration: 120
instance_type: mac_mini_m1
environment:
android_signing:
- speed
groups:
- google_play
vars:
PACKAGE_NAME: "be.rubengerits.speed"
JAVA_HOME: "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home"
scripts:
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/local.properties"
- name: Build Android release
script: |
LATEST_GOOGLE_PLAY_BUILD_NUMBER=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME")
if [ -z LATEST_BUILD_NUMBER ]; then
# fallback in case no build number was found from google play. Alternatively, you can `exit 1` to fail the build
UPDATED_BUILD_NUMBER=$BUILD_NUMBER
else
UPDATED_BUILD_NUMBER=$(($LATEST_GOOGLE_PLAY_BUILD_NUMBER + 1))
fi
./gradlew bundleRelease -PversionCode=$UPDATED_BUILD_NUMBER -PversionName=1.0.$UPDATED_BUILD_NUMBER
artifacts:
- app/build/outputs/**/*.aab
publishing:
email:
recipients:
- rubengerits360@gmail.com
notify:
success: true
failure: true
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: internal
submit_as_draft: true