0.2.64 update
This commit is contained in:
+15
-4
@@ -67,6 +67,17 @@ val localProperties = Properties().apply {
|
||||
fun localProperty(key: String): String? =
|
||||
localProperties.getProperty(key)?.trim()?.takeIf { it.isNotEmpty() }
|
||||
|
||||
// Compose mounts release credentials as files under /run/secrets. Supporting the
|
||||
// conventional *_FILE form keeps those values out of the container configuration;
|
||||
// the direct environment-variable form remains for the existing PowerShell scripts.
|
||||
fun environmentSecret(key: String): String? {
|
||||
val path = System.getenv("${key}_FILE")?.trim().orEmpty()
|
||||
if (path.isNotEmpty()) {
|
||||
return rootProject.file(path).readText().trim().takeIf { it.isNotEmpty() }
|
||||
}
|
||||
return System.getenv(key)?.trim()?.takeIf { it.isNotEmpty() }
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.ponzischeme89.memby"
|
||||
compileSdk = 35
|
||||
@@ -106,16 +117,16 @@ android {
|
||||
// different app and forces users to uninstall first. Keep the keystore and these
|
||||
// credentials off the repo: set them in local.properties (gitignored) or the
|
||||
// environment. Without them, `assembleRelease` still builds but stays unsigned.
|
||||
val keystorePath = localProperty("memby.keystore") ?: System.getenv("MEMBY_KEYSTORE")
|
||||
val keystorePath = localProperty("memby.keystore") ?: environmentSecret("MEMBY_KEYSTORE")
|
||||
val hasKeystore = !keystorePath.isNullOrBlank() && file(keystorePath).exists()
|
||||
|
||||
signingConfigs {
|
||||
if (hasKeystore) {
|
||||
create("release") {
|
||||
storeFile = file(keystorePath!!)
|
||||
storePassword = localProperty("memby.keystorePassword") ?: System.getenv("MEMBY_KEYSTORE_PASSWORD")
|
||||
keyAlias = localProperty("memby.keyAlias") ?: System.getenv("MEMBY_KEY_ALIAS") ?: "memby"
|
||||
keyPassword = localProperty("memby.keyPassword") ?: System.getenv("MEMBY_KEY_PASSWORD")
|
||||
storePassword = localProperty("memby.keystorePassword") ?: environmentSecret("MEMBY_KEYSTORE_PASSWORD")
|
||||
keyAlias = localProperty("memby.keyAlias") ?: environmentSecret("MEMBY_KEY_ALIAS") ?: "memby"
|
||||
keyPassword = localProperty("memby.keyPassword") ?: environmentSecret("MEMBY_KEY_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user