Skip to content

Commit

Permalink
removed local.properties. using envoriment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JudjinGM committed Nov 28, 2023
1 parent 9d429f0 commit 8750fbc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/checkPRToDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
echo "storePassword=$STORE_PASSWORD" > ./local.properties
echo "keyAlias=$KEY_ALIAS" >> ./local.properties
echo "keyPassword=$KEY_PASSWORD" >> ./local.properties
./gradlew :app:build
- name: Check status
Expand Down
21 changes: 16 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,22 @@ android {

signingConfigs {
create("release") {

val localProperties = gradleLocalProperties(rootDir)
val storePasswordLocal = localProperties.getProperty("storePassword") ?: "storePasswordEmpty"
val keyAliasLocal = localProperties.getProperty("keyAlias") ?: "keyAliasEmpty"
val keyPasswordLocal = localProperties.getProperty("keyPassword") ?: "keyPasswordEmpty"
val storePasswordLocal: String
val keyAliasLocal: String
val keyPasswordLocal: String

val localPropertiesFile = file("${rootDir}/local.properties")

if (localPropertiesFile.exists()) {
val localProperties = gradleLocalProperties(rootDir)
storePasswordLocal = localProperties.getProperty("storePassword") ?: "storePasswordEmpty"
keyAliasLocal = localProperties.getProperty("keyAlias") ?: "keyAliasEmpty"
keyPasswordLocal = localProperties.getProperty("keyPassword") ?: "keyPasswordEmpty"
} else {
storePasswordLocal = System.getenv("STORE_PASSWORD") ?: "storePasswordEmpty"
keyAliasLocal = System.getenv("KEY_ALIAS") ?: "keyAliasEmpty"
keyPasswordLocal = System.getenv("KEY_PASSWORD") ?: "keyPasswordEmpty"
}

storeFile = file("keyStore/cashadvisor.jks")
storePassword = storePasswordLocal
Expand Down

0 comments on commit 8750fbc

Please sign in to comment.