fix: make Android signing config conditional on ANDROID_KEYSTORE_PATH (#440)
## Summary
- `BuildAndroidRelease` in `ci/main.go` intentionally builds the AAB without setting up the keystore — the unsigned AAB is later stamped with `StampAndroidVersionCode` and re-signed by `SignAndroidBundle` via jarsigner.
- The old `signingConfigs.create("release")` block in `android/app/build.gradle.kts` called `error("ANDROID_KEYSTORE_PATH is not set")` at Gradle _configuration_ time, which fired even when the keystore wasn't needed for the build step.
- Fix: guard the `signingConfigs` block and the `signingConfig` assignment in the release build type behind a null-check on `ANDROID_KEYSTORE_PATH`. When the env var is absent (unsigned build path), Gradle skips the signing config entirely; when it is present (e.g. `BuildAndroidApk` via `setupKeystore`), the config is created and applied as before.
## Test plan
- Trigger `deploy.yml` via `workflow_dispatch` and verify the `Build & Deploy to Play Store` job no longer fails at step 4 with "ANDROID_KEYSTORE_PATH is not set"
- Verify `BuildAndroidApk` (which calls `setupKeystore`) still produces a correctly signed APK
Closes #439
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Thomas SharedInbox <sharedinbox@thomas-guettler.de>
Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/440
This commit was merged in pull request #440.
This commit is contained in:
committed by
guettli
co-authored by
guettli
Thomas SharedInbox
parent
31c0479fc9
commit
7a4defbab4
@@ -22,13 +22,17 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = "upload"
|
||||
val pass = System.getenv("ANDROID_KEYSTORE_PASSWORD")
|
||||
storePassword = pass
|
||||
keyPassword = pass
|
||||
storeFile = file(System.getenv("ANDROID_KEYSTORE_PATH") ?: error("ANDROID_KEYSTORE_PATH is not set"))
|
||||
val ksPath: String? = System.getenv("ANDROID_KEYSTORE_PATH")
|
||||
|
||||
if (ksPath != null) {
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = "upload"
|
||||
val pass = System.getenv("ANDROID_KEYSTORE_PASSWORD") ?: ""
|
||||
storePassword = pass
|
||||
keyPassword = pass
|
||||
storeFile = file(ksPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +48,9 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
if (ksPath != null) {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
ndk {
|
||||
|
||||
Reference in New Issue
Block a user