Skip to content

Commit 6dc0ee2

Browse files
authored
Merge pull request #59 from v2er-app/bugfix/release-signing-config
2 parents deb8d0d + 6e4515f commit 6dc0ee2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

app/build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ android {
2929
storePassword GHUI_KEYSTORE_PASSWORD
3030
keyAlias project.hasProperty("GHUI_KEY_ALIAS") ? GHUI_KEY_ALIAS : "ghui"
3131
keyPassword GHUI_KEY_PASSWORD
32+
} else if (project.hasProperty("GHUI_KEYSTORE_PASSWORD") && project.hasProperty("GHUI_KEY_PASSWORD")) {
33+
// CI/CD environment but keystore file might not exist yet
34+
// This prevents the build from failing during configuration phase
35+
storeFile file("keystore.jks")
36+
storePassword GHUI_KEYSTORE_PASSWORD
37+
keyAlias project.hasProperty("GHUI_KEY_ALIAS") ? GHUI_KEY_ALIAS : "ghui"
38+
keyPassword GHUI_KEY_PASSWORD
3239
} else {
33-
// For local builds without proper signing setup, use debug signing
34-
def debugSigningConfig = android.signingConfigs.debug
35-
storeFile debugSigningConfig.storeFile
36-
storePassword debugSigningConfig.storePassword
37-
keyAlias debugSigningConfig.keyAlias
38-
keyPassword debugSigningConfig.keyPassword
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.")
3942
}
4043
}
4144
}

0 commit comments

Comments
 (0)