fix(ci): read key.properties for release signing with Kotlin imports
Build & Deploy Farolero / Análisis de código (push) Successful in 11s
Build & Deploy Farolero / Build APK + AAB release (push) Successful in 1m10s

This commit is contained in:
2026-07-25 22:12:56 +02:00
parent 56ff48a576
commit dfd00c71bb
+25 -1
View File
@@ -1,9 +1,18 @@
import java.util.Properties
import java.io.FileInputStream
plugins { plugins {
id("com.android.application") id("com.android.application")
id("kotlin-android") id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
} }
val keystorePropertiesFile = rootProject.file("key.properties")
val keystoreProperties = Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android { android {
namespace = "es.freetimelab.farolero.game" namespace = "es.freetimelab.farolero.game"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
@@ -26,9 +35,24 @@ android {
versionName = flutter.versionName versionName = flutter.versionName
} }
signingConfigs {
if (keystorePropertiesFile.exists()) {
create("release") {
keyAlias = keystoreProperties.getProperty("keyAlias") ?: ""
keyPassword = keystoreProperties.getProperty("keyPassword") ?: ""
storeFile = keystoreProperties.getProperty("storeFile")?.let { file(it) }
storePassword = keystoreProperties.getProperty("storePassword") ?: ""
}
}
}
buildTypes { buildTypes {
release { release {
signingConfig = signingConfigs.getByName("debug") signingConfig = if (keystorePropertiesFile.exists()) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
}
} }
} }
} }