@@ -22,23 +22,16 @@ android {
2222 }
2323
2424 release {
25- // Release signing is only configured when keystore is provided via CI/CD
26- // The keystore will be decoded from KEYSTORE_BASE64 and placed temporarily
27- if (file(" keystore.jks" ). exists() && project. hasProperty(" GHUI_KEYSTORE_PASSWORD" ) && project. hasProperty(" GHUI_KEY_PASSWORD" )) {
28- storeFile file(" keystore.jks" )
29- storePassword GHUI_KEYSTORE_PASSWORD
30- keyAlias project. hasProperty(" GHUI_KEY_ALIAS" ) ? GHUI_KEY_ALIAS : " ghui"
31- keyPassword GHUI_KEY_PASSWORD
32- } else if (System . getenv(" GHUI_KEYSTORE_PASSWORD" ) != null && System . getenv(" GHUI_KEY_PASSWORD" ) != null ) {
33- // CI/CD environment but keystore file might not exist yet
34- // This prevents the build from failing during configuration phase
25+ // Release signing requires environment variables to be set
26+ // The keystore will be decoded from KEYSTORE_BASE64 in CI/CD
27+ if (System . getenv(" GHUI_KEYSTORE_PASSWORD" ) != null && System . getenv(" GHUI_KEY_PASSWORD" ) != null ) {
3528 storeFile file(" keystore.jks" )
3629 storePassword System . getenv(" GHUI_KEYSTORE_PASSWORD" )
3730 keyAlias (System . getenv(" GHUI_KEY_ALIAS" ) ?: " " ). trim(). isEmpty() ? " ghui" : System . getenv(" GHUI_KEY_ALIAS" )
3831 keyPassword System . getenv(" GHUI_KEY_PASSWORD" )
3932 } else {
40- // For local builds without proper signing setup, throw an error
41- throw new GradleException (" Release builds require signing configuration. Please provide GHUI_KEYSTORE_PASSWORD and GHUI_KEY_PASSWORD." )
33+ // Release builds require proper environment variables
34+ throw new GradleException (" Release builds require signing configuration. Please set GHUI_KEYSTORE_PASSWORD and GHUI_KEY_PASSWORD environment variables ." )
4235 }
4336 }
4437 }
0 commit comments