v1.5.0-hotfix4: Create keystore.properties in workflow

This commit is contained in:
zarzet
2026-01-02 04:17:24 +07:00
parent 7aa3e77df1
commit 562fd4d7bb
5 changed files with 14 additions and 25 deletions
+5 -15
View File
@@ -5,16 +5,13 @@ plugins {
id("dev.flutter.flutter-gradle-plugin")
}
// Load keystore properties from file if exists (local build)
// Load keystore properties from file if exists
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = java.util.Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(java.io.FileInputStream(keystorePropertiesFile))
}
// CI keystore file (decoded by workflow)
val ciKeystoreFile = file("ci-keystore.jks")
android {
namespace = "com.zarz.spotiflac"
compileSdk = flutter.compileSdkVersion
@@ -33,19 +30,12 @@ android {
}
signingConfigs {
create("release") {
if (keystorePropertiesFile.exists()) {
// Local build: use keystore.properties
storeFile = file(keystoreProperties["storeFile"] as String)
if (keystorePropertiesFile.exists()) {
create("release") {
storeFile = file("app/${keystoreProperties["storeFile"]}")
storePassword = keystoreProperties["storePassword"] as String
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
} else if (ciKeystoreFile.exists()) {
// CI/CD build: use decoded keystore from workflow
storeFile = ciKeystoreFile
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEY_ALIAS")
keyPassword = System.getenv("KEY_PASSWORD")
}
}
}
@@ -68,7 +58,7 @@ android {
buildTypes {
release {
// Use release signing config if available, otherwise fall back to debug
signingConfig = if (signingConfigs.findByName("release")?.storeFile != null) {
signingConfig = if (keystorePropertiesFile.exists()) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")