Refactor Android build process to support update-compatible APKs and add shared debug keystore configuration

This commit is contained in:
jahruz67
2026-05-21 23:03:25 -07:00
parent 6a5e289f68
commit d563a12f11
5 changed files with 23 additions and 8 deletions
+1 -7
View File
@@ -26,16 +26,10 @@ jobs:
- name: Set up Gradle - name: Set up Gradle
uses: gradle/actions/setup-gradle@v4 uses: gradle/actions/setup-gradle@v4
- name: Cache Android debug keystore
uses: actions/cache@v4
with:
path: ~/.android/debug.keystore
key: android-debug-keystore-${{ runner.os }}
- name: Make Gradle wrapper executable - name: Make Gradle wrapper executable
run: chmod +x gradlew run: chmod +x gradlew
- name: Build debug APK - name: Build update-compatible APK
run: ./gradlew assembleDebug -PciVersionCode=${{ github.run_number }} -PciVersionName=1.0.${{ github.run_number }} run: ./gradlew assembleDebug -PciVersionCode=${{ github.run_number }} -PciVersionName=1.0.${{ github.run_number }}
- name: Prepare release assets - name: Prepare release assets
+18
View File
@@ -4,11 +4,21 @@ plugins {
def ciVersionCode = providers.gradleProperty("ciVersionCode").getOrNull() def ciVersionCode = providers.gradleProperty("ciVersionCode").getOrNull()
def ciVersionName = providers.gradleProperty("ciVersionName").getOrNull() def ciVersionName = providers.gradleProperty("ciVersionName").getOrNull()
def sharedDebugKeystore = file("signing/bible-daily-debug.keystore")
android { android {
namespace "com.bibliadiaria.app" namespace "com.bibliadiaria.app"
compileSdk 35 compileSdk 35
signingConfigs {
sharedDebug {
storeFile sharedDebugKeystore
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
defaultConfig { defaultConfig {
applicationId "com.bibliadiaria.app" applicationId "com.bibliadiaria.app"
minSdk 23 minSdk 23
@@ -17,6 +27,14 @@ android {
versionName ciVersionName != null ? ciVersionName : "1.0" versionName ciVersionName != null ? ciVersionName : "1.0"
} }
buildTypes {
debug {
if (sharedDebugKeystore.exists()) {
signingConfig signingConfigs.sharedDebug
}
}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17
+3
View File
@@ -0,0 +1,3 @@
This debug keystore is intentionally shared by local and GitHub Actions builds so sideloaded APK updates keep the same Android signing identity.
Do not use this key for Play Store or production release signing.
Binary file not shown.
File diff suppressed because one or more lines are too long