Skip to content

Commit

Permalink
Fix building and testing for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTI1208 committed Mar 26, 2023
1 parent f40efca commit c24d537
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ jobs:
- run: chmod +x gradlew
- name: Build debug
run: |
echo "${{ secrets.ANDROID_SIGNATURE }}" > signature.jks.asc
gpg -d --batch --passphrase ${{ secrets.ANDROID_SIGNATURE_PASS }} signature.jks.asc > signature.jks
export signing_storeFile=$(pwd)/signature.jks
export signing_storePassword=${{ secrets.ANDROID_SIGNATURE_STORE_PASS }}
export signing_keyAlias=${{ secrets.ANDROID_SIGNATURE_KEY }}
export signing_keyPassword=${{ secrets.ANDROID_SIGNATURE_KEY_PASS }}
./gradlew clean
./gradlew assembleDebug -x check
6 changes: 0 additions & 6 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,5 @@ jobs:
- run: chmod +x gradlew
- name: Unit test
run: |
echo "${{ secrets.ANDROID_SIGNATURE }}" > signature.jks.asc
gpg -d --batch --passphrase ${{ secrets.ANDROID_SIGNATURE_PASS }} signature.jks.asc > signature.jks
export signing_storeFile=$(pwd)/signature.jks
export signing_storePassword=${{ secrets.ANDROID_SIGNATURE_STORE_PASS }}
export signing_keyAlias=${{ secrets.ANDROID_SIGNATURE_KEY }}
export signing_keyPassword=${{ secrets.ANDROID_SIGNATURE_KEY_PASS }}
./gradlew clean
./gradlew test
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ android {

val fromProperties = props.hasProperty("signing.storeFile")

fun stringProperty(key: String): String {
fun stringProperty(key: String): String? {
return if (fromProperties) props.getProperty(key)
else System.getenv(key.replace('.', '_'))
}

storeFile = File(stringProperty("signing.storeFile"))
val storeFilePath = stringProperty("signing.storeFile") ?: return@create
storeFile = File(storeFilePath)
storePassword = stringProperty("signing.storePassword")
keyAlias = stringProperty("signing.keyAlias")
keyPassword = stringProperty("signing.keyPassword")
Expand Down

0 comments on commit c24d537

Please sign in to comment.