@@ -22,23 +22,16 @@ android {
22
22
}
23
23
24
24
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 ) {
35
28
storeFile file(" keystore.jks" )
36
29
storePassword System . getenv(" GHUI_KEYSTORE_PASSWORD" )
37
30
keyAlias (System . getenv(" GHUI_KEY_ALIAS" ) ?: " " ). trim(). isEmpty() ? " ghui" : System . getenv(" GHUI_KEY_ALIAS" )
38
31
keyPassword System . getenv(" GHUI_KEY_PASSWORD" )
39
32
} 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 ." )
42
35
}
43
36
}
44
37
}
0 commit comments