Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ plugins {
android {
compileSdk 36
namespace = "com.kharagedition.tibetankeyboard"
signingConfigs {
release {
if (System.getenv("CM_KEYSTORE_PATH")) {
storeFile file(System.getenv("CM_KEYSTORE_PATH"))
storePassword System.getenv("CM_KEYSTORE_PASSWORD")
keyAlias System.getenv("CM_KEY_ALIAS")
keyPassword System.getenv("CM_KEY_PASSWORD")
}
}
}
defaultConfig {
applicationId "com.kharagedition.tibetankeyboard"
minSdkVersion 23
targetSdkVersion 36
versionCode 52
versionCode project.hasProperty('versionCode') ? project.property('versionCode').toInteger() : 53

versionName "2.2.10"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -27,6 +38,7 @@ android {

buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand Down
104 changes: 104 additions & 0 deletions codemagic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
workflows:

# ── Release workflow ────────────────────────────────────────────────────────
# Triggers on every push to main. Builds a signed AAB and uploads it to the
# Google Play internal track as a draft for your review before promoting.
android-release:
name: Android Release (AAB → Play Store)
max_build_duration: 90
instance_type: mac_mini_m2

triggering:
events:
- push
branch_patterns:
- pattern: main
include: true

environment:
# Upload your keystore under Teams → Code signing identities and give
# it the reference name "keystore_reference" (matches the name below).
android_signing:
- keystore_reference
# Create an environment variable group called "google_play" and add
# GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS (the JSON key file content).
groups:
- google_play
vars:
PACKAGE_NAME: "com.kharagedition.tibetankeyboard"
java: 17

scripts:
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/local.properties"

- name: Build release AAB
script: |
# Auto-increment version code based on what's already on the Play Store.
LATEST=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME" 2>/dev/null || echo "")
if [ -z "$LATEST" ]; then
VERSION_CODE=$BUILD_NUMBER
else
VERSION_CODE=$(($LATEST + 1))
fi
echo "Building versionCode=$VERSION_CODE"
./gradlew bundleRelease -PversionCode=$VERSION_CODE

artifacts:
- app/build/outputs/**/*.aab
- app/build/outputs/**/mapping.txt

publishing:
email:
recipients:
- developer.kharag@gmail.com
notify:
success: true
failure: true
google_play:
credentials: $GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS
track: internal
submit_as_draft: true

# ── Debug / PR workflow ─────────────────────────────────────────────────────
# Runs on every pull request. Builds the debug APK and runs unit tests.
# No signing or publishing needed here.
android-debug:
name: Android Debug (PR checks)
max_build_duration: 60
instance_type: mac_mini_m2

triggering:
events:
- pull_request
branch_patterns:
- pattern: '*'
include: true

environment:
java: 17

scripts:
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/local.properties"

- name: Build debug APK
script: |
./gradlew assembleDebug

- name: Run unit tests
script: |
./gradlew :botok:test :app:testDebugUnitTest

artifacts:
- app/build/outputs/**/*.apk

publishing:
email:
recipients:
- developer.kharag@gmail.com
notify:
success: false
failure: true
Loading