gradle: Enforce release build is signed

This commit is contained in:
Jules Aguillon 2024-01-08 22:49:59 +01:00
parent e26e1d112c
commit 3f2f3177da

View File

@ -34,17 +34,14 @@ android {
keyAlias(System.env.DEBUG_KEY_ALIAS ? "$System.env.DEBUG_KEY_ALIAS" : "debug") keyAlias(System.env.DEBUG_KEY_ALIAS ? "$System.env.DEBUG_KEY_ALIAS" : "debug")
keyPassword(System.env.DEBUG_KEY_PASSWORD ? "$System.env.DEBUG_KEY_PASSWORD" : "debug0") keyPassword(System.env.DEBUG_KEY_PASSWORD ? "$System.env.DEBUG_KEY_PASSWORD" : "debug0")
} }
// Release builds will only be signed with a dedicated key if specified. This key has to be
// created manually.
release { release {
if (System.env.RELEASE_KEYSTORE) {
storeFile file(System.env.RELEASE_KEYSTORE) storeFile file(System.env.RELEASE_KEYSTORE)
storePassword "$System.env.RELEASE_KEYSTORE_PASSWORD" storePassword "$System.env.RELEASE_KEYSTORE_PASSWORD"
keyAlias "$System.env.RELEASE_KEY_ALIAS" keyAlias "$System.env.RELEASE_KEY_ALIAS"
keyPassword "$System.env.RELEASE_KEY_PASSWORD" keyPassword "$System.env.RELEASE_KEY_PASSWORD"
} }
} }
}
buildTypes { buildTypes {
release { release {
@ -53,10 +50,9 @@ android {
debuggable false debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
resValue "string", "app_name", "@string/app_name_release" resValue "string", "app_name", "@string/app_name_release"
if (System.env.RELEASE_KEYSTORE) {
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
}
debug { debug {
minifyEnabled false minifyEnabled false
shrinkResources false shrinkResources false