fix(ci): load release signing from key properties
This commit is contained in:
@@ -4,6 +4,18 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
import java.util.Properties
|
||||
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
|
||||
}
|
||||
|
||||
fun secret(name: String, propertyName: String): String? =
|
||||
keystoreProperties.getProperty(propertyName)?.takeIf { it.isNotBlank() }
|
||||
?: System.getenv(name)?.takeIf { it.isNotBlank() }
|
||||
|
||||
android {
|
||||
namespace = "es.freetimelab.pluriwave"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
@@ -28,9 +40,23 @@ android {
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
// Configurado por el workflow via android/key.properties
|
||||
// Keystore: ~/.openclaw/workspace/.secure/pluriwave/pluriwave-upload.jks
|
||||
// Alias: pluriwave-upload
|
||||
val storeFilePath = secret("KEYSTORE_PATH", "storeFile")
|
||||
val storePasswordValue = secret("KEYSTORE_PASSWORD", "storePassword")
|
||||
val keyAliasValue = secret("KEYSTORE_ALIAS", "keyAlias")
|
||||
val keyPasswordValue = secret("KEY_PASSWORD", "keyPassword")
|
||||
|
||||
if (!storeFilePath.isNullOrBlank()) {
|
||||
storeFile = file(storeFilePath)
|
||||
}
|
||||
if (!storePasswordValue.isNullOrBlank()) {
|
||||
storePassword = storePasswordValue
|
||||
}
|
||||
if (!keyAliasValue.isNullOrBlank()) {
|
||||
keyAlias = keyAliasValue
|
||||
}
|
||||
if (!keyPasswordValue.isNullOrBlank()) {
|
||||
keyPassword = keyPasswordValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user