diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 936cead4..3f7db85d 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -26,13 +26,22 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - - name: Generating one-time APK signature key - run: keytool -genkey -v -keystore keystore.jks -alias Nostros -keyalg RSA -keysize 2048 -validity 10000 -storepass ${{ secrets.KEY_STORE_PASS }} -keypass ${{ secrets.KEY_PASS }} -dname "cn=Nostros, ou=Actions, o=Nostros, c=GitHub" + - name: Decode Keystore + id: decode_keystore + uses: timheuer/base64-to-file@v1.2 + with: + fileName: 'keystore.jks' + fileDir: './' + encodedString: ${{ secrets.KEYSTORE }} - name: 'Build Android Release' run: | cd android ./gradlew assembleRelease + env: + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASS: ${{ secrets.KEY_PASS }} + KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }} - name: 'Check for non-FOSS libraries' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f87ce06e..13720ce0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,11 +9,6 @@ on: jobs: android-build: uses: KoalaSat/nostros/.github/workflows/android-build.yml@main - with: - env: - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASS: ${{ secrets.KEY_PASS }} - KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }} release: needs: [android-build] runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index d7153252..afb22dcf 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,6 @@ local.properties *.iml *.hprof .cxx/ -*.keystore -!debug.keystore # node.js # diff --git a/android/app/build.gradle b/android/app/build.gradle index 56466183..4198a6af 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -128,19 +128,10 @@ android { } release { - // We can leave these in environment variables - storeFile file('../../keystore.jks') + storeFile file("../../keystore.jks") keyAlias System.getenv("KEY_ALIAS") - - // These two lines make gradle believe that the signingConfigs - // section is complete. Without them, tasks like installRelease - // will not be available! storePassword System.getenv("KEY_STORE_PASS") keyPassword System.getenv("KEY_PASS") - - enableV1Signing true - enableV2Signing true - enableV3Signing true } } buildTypes { diff --git a/android/app/keystore.jks b/android/app/keystore.jks new file mode 100644 index 00000000..b706689a Binary files /dev/null and b/android/app/keystore.jks differ