Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
ci: Enable signing for workflow artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Dec 10, 2023
1 parent ea8021e commit 186c780
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
import java.io.ByteArrayOutputStream
import java.util.Properties

plugins {
id("com.android.application")
Expand All @@ -17,13 +18,33 @@ android {
versionCode = getVersionCode()
versionName = "1.0" + "-" + getVersionName()
}

val properties = Properties()
runCatching { properties.load(project.rootProject.file("local.properties").inputStream()) }
val keystorePath = properties.getProperty("KEYSTORE_PATH") ?: System.getenv("KEYSTORE_PATH")
val keystorePwd = properties.getProperty("KEYSTORE_PASS") ?: System.getenv("KEYSTORE_PASS")
val alias = properties.getProperty("KEY_ALIAS") ?: System.getenv("KEY_ALIAS")
val pwd = properties.getProperty("KEY_PASSWORD") ?: System.getenv("KEY_PASSWORD")
if (keystorePath != null) {
signingConfigs {
create("release") {
storeFile = file(keystorePath)
storePassword = keystorePwd
keyAlias = alias
keyPassword = pwd
enableV2Signing = true
enableV3Signing = true
enableV4Signing = true
}
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
if (keystorePath != null) signingConfig = signingConfigs.getByName("release")
}
debug {
if (keystorePath != null) signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
Expand Down

0 comments on commit 186c780

Please sign in to comment.