From 279fd7936ed409e8e0f4f5b847579c3273836796 Mon Sep 17 00:00:00 2001 From: Yiheng Date: Sat, 25 Nov 2023 12:41:44 +1100 Subject: [PATCH] use key.properties instead --- .github/workflows/apk.yml | 13 +++++++++++++ project/android/app/build.gradle | 10 ++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/apk.yml b/.github/workflows/apk.yml index 30b962c..a7dffb4 100644 --- a/.github/workflows/apk.yml +++ b/.github/workflows/apk.yml @@ -30,6 +30,19 @@ jobs: echo "Keystore file does not exist." exit 1 fi + - name: Provide key.properties + run: | + cd project + cd android + echo '${{ secrets.KEY_PROPERTIES }}' > key.properties + - name: Validate keystore & key.properties + run: | + cd project/android + if test -f key.properties && test -f app/keystore/android_keystore.jks; then + echo "Keystore and key.properties are valid." + else + exit 1 + fi - uses: actions/setup-java@v2 with: distribution: 'zulu' diff --git a/project/android/app/build.gradle b/project/android/app/build.gradle index cef5f15..3e4c334 100644 --- a/project/android/app/build.gradle +++ b/project/android/app/build.gradle @@ -33,17 +33,15 @@ android { signingConfigs { release { - storeFile = file("keystore/android_keystore.jks") - storePassword System.getenv("SIGNING_STORE_PASSWORD") - keyAlias System.getenv("SIGNING_KEY_ALIAS") - keyPassword System.getenv("SIGNING_KEY_PASSWORD") + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] } } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.release } debug {