From 6e4515fc26433ac300c9d85ded0659743f24b433 Mon Sep 17 00:00:00 2001 From: Gray Zhang Date: Wed, 9 Jul 2025 23:05:33 +0800 Subject: [PATCH] fix: Fix release signing configuration for CI/CD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove fallback to debug keystore which causes build failures - Add proper handling for CI/CD environment where keystore is created dynamically - Throw explicit error for local release builds without signing config - Fixes the "debug.keystore not found" error in release workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/build.gradle | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index de7885eb..1716f98f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,13 +29,16 @@ android { storePassword GHUI_KEYSTORE_PASSWORD keyAlias project.hasProperty("GHUI_KEY_ALIAS") ? GHUI_KEY_ALIAS : "ghui" keyPassword GHUI_KEY_PASSWORD + } else if (project.hasProperty("GHUI_KEYSTORE_PASSWORD") && project.hasProperty("GHUI_KEY_PASSWORD")) { + // CI/CD environment but keystore file might not exist yet + // This prevents the build from failing during configuration phase + storeFile file("keystore.jks") + storePassword GHUI_KEYSTORE_PASSWORD + keyAlias project.hasProperty("GHUI_KEY_ALIAS") ? GHUI_KEY_ALIAS : "ghui" + keyPassword GHUI_KEY_PASSWORD } else { - // For local builds without proper signing setup, use debug signing - def debugSigningConfig = android.signingConfigs.debug - storeFile debugSigningConfig.storeFile - storePassword debugSigningConfig.storePassword - keyAlias debugSigningConfig.keyAlias - keyPassword debugSigningConfig.keyPassword + // For local builds without proper signing setup, throw an error + throw new GradleException("Release builds require signing configuration. Please provide GHUI_KEYSTORE_PASSWORD and GHUI_KEY_PASSWORD.") } } }