Skip to content

Commit

Permalink
build,refactor: change the way to resolve keystore.properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Jan 17, 2024
1 parent ee9e899 commit 94b0a23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:

- name: Setup keystore
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 --decode | cat >> signingkey.jks
echo ${{ secrets.SIGNING_KEY }} | base64 --decode | cat >> $(pwd)/signingkey.jks
cat << EOF > keystore.properties
storeFile=signingkey.jks
storeFile=$(pwd)/signingkey.jks
storePassword=${{ secrets.KEY_STORE_PASSWORD }}
keyAlias=${{ secrets.ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
Expand Down
10 changes: 5 additions & 5 deletions build-logic/convention/src/main/kotlin/ApkRelease.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import java.util.Properties
object ApkRelease {
private const val KEYSTORE_PROPERTIES = "keystore.properties"

private val props by lazy {
File(KEYSTORE_PROPERTIES).takeIf { it.exists() }
?.let { Properties().apply { load(it.inputStream()) } }
?: Properties()
}
private val Project.props: Properties
get() =
rootProject.file(KEYSTORE_PROPERTIES).takeIf { it.exists() }
?.let { Properties().apply { load(it.inputStream()) } }
?: Properties()

val Project.storeFile
get() = props["storeFile"] as? String
Expand Down

0 comments on commit 94b0a23

Please sign in to comment.