build: sign releases with a dedicated key kept outside the repo
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
.giteatoken
|
||||||
|
*.jks
|
||||||
|
keystore.properties
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
@@ -19,12 +21,25 @@ android {
|
|||||||
versionName = "0.1.0"
|
versionName = "0.1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release key lives outside the repo; without it, release builds fall back to the debug key (local only).
|
||||||
|
val keyProps = Properties().apply {
|
||||||
|
val f = file(System.getProperty("user.home") + "/.android/nogoogleapps-release.properties")
|
||||||
|
if (f.exists()) f.inputStream().use { load(it) }
|
||||||
|
}
|
||||||
|
signingConfigs {
|
||||||
|
if (keyProps.isNotEmpty()) create("release") {
|
||||||
|
storeFile = file(keyProps.getProperty("storeFile"))
|
||||||
|
storePassword = keyProps.getProperty("storePassword")
|
||||||
|
keyAlias = keyProps.getProperty("keyAlias")
|
||||||
|
keyPassword = keyProps.getProperty("keyPassword")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
// local installs only; a real release key comes with /replica-deploy
|
signingConfig = signingConfigs.findByName("release") ?: signingConfigs.getByName("debug")
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user