Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1412621 committed May 6, 2024
1 parent 255e7a7 commit e80b2e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
append_body: true
body: ${{ env.RELEASE_NOTE }}

build_release_play:
build_release_google_play:
environment: production
runs-on: ubuntu-latest
steps:
Expand Down
31 changes: 14 additions & 17 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.api.dsl.ApkSigningConfig

import java.io.FileInputStream
import java.util.Properties

Expand Down Expand Up @@ -32,33 +34,28 @@ android {
}

signingConfigs {
fun loadProperties(propertiesFile: String): Properties? {
fun buildSignKey(
propertiesFile: String,
apkSigningConfig: ApkSigningConfig
) {
val keystorePropertiesFile = rootProject.file(propertiesFile)
// skip for test
if (keystorePropertiesFile.exists()) {
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
return keystoreProperties
keystoreProperties.let {
apkSigningConfig.storeFile = rootProject.file(it["storeFile"] as String)
apkSigningConfig.storePassword = it["storePassword"] as String
apkSigningConfig.keyAlias = it["keyAlias"] as String
apkSigningConfig.keyPassword = it["keyPassword"] as String
}
}
return null
}
create("githubReleaseKey") {
loadProperties("keystore.properties")
?.let {
storeFile = rootProject.file(it["storeFile"] as String)
storePassword = it["storePassword"] as String
keyAlias = it["keyAlias"] as String
keyPassword = it["keyPassword"] as String
}
buildSignKey("keystore.properties", this)
}
create("playUploadKey") {
loadProperties("keystore.properties")
?.let {
storeFile = rootProject.file(it["storeFile"] as String)
storePassword = it["storePassword"] as String
keyAlias = it["keyAlias"] as String
keyPassword = it["keyPassword"] as String
}
buildSignKey("keystore.properties", this)
}
}

Expand Down

0 comments on commit e80b2e1

Please sign in to comment.