diff --git a/.github/workflows/tests_emulator.yml b/.github/workflows/tests_emulator.yml index 4d4c6dad43bb..50f33570c0fe 100644 --- a/.github/workflows/tests_emulator.yml +++ b/.github/workflows/tests_emulator.yml @@ -21,12 +21,6 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} TEST_RELEASE_BUILD: true - # could be better, '/home/runner' should be '~/' but neither that nor '$HOME' worked - STOREFILEDIR: /home/runner/src - STOREFILE: android-keystore - STOREPASS: testpass - KEYPASS: testpass - KEYALIAS: nrkeystorealias strategy: fail-fast: false matrix: @@ -51,15 +45,6 @@ jobs: swap-storage: false docker-images: false - - name: Test Credential Prep - run: | - echo "KSTOREPWD=$STOREPASS" >> $GITHUB_ENV - echo "KEYPWD=$KEYPASS" >> $GITHUB_ENV - mkdir $STOREFILEDIR - cd $STOREFILEDIR - echo y | keytool -genkeypair -dname "cn=AnkiDroid, ou=ankidroid, o=AnkiDroid, c=US" -alias $KEYALIAS -keypass $KEYPASS -keystore "$STOREFILE" -storepass $STOREPASS -keyalg RSA -validity 20000 - shell: bash - - uses: actions/checkout@v4 with: fetch-depth: 50 @@ -197,4 +182,4 @@ jobs: - uses: codecov/codecov-action@v5 with: verbose: true - fail_ci_if_error: ${{ github.repository == 'ankidroid/Anki-Android' }} # optional (default = false) + fail_ci_if_error: ${{ github.repository == 'ankidroid/Anki-Android' }} # optional (default = false) \ No newline at end of file diff --git a/AnkiDroid/build.gradle b/AnkiDroid/build.gradle index ea75cd815017..fe68574f09d2 100644 --- a/AnkiDroid/build.gradle +++ b/AnkiDroid/build.gradle @@ -97,10 +97,18 @@ android { } signingConfigs { release { - storeFile file(System.getenv("KEYSTOREPATH") ?: "${homePath}/src/android-keystore") - storePassword System.getenv("KEYSTOREPWD") ?: System.getenv("KSTOREPWD") - keyAlias System.getenv("KEYALIAS") ?: "nrkeystorealias" - keyPassword System.getenv("KEYPWD") + def keystorePath = System.getenv("KEYSTOREPATH") + if (keystorePath != null && !keystorePath.trim().isEmpty()) { + storeFile file(keystorePath) + storePassword System.getenv("KEYSTOREPWD") ?: System.getenv("KSTOREPWD") + keyAlias System.getenv("KEYALIAS") + keyPassword System.getenv("KEYPWD") + } else { + storeFile file("${rootDir}/tools/fallback-release-keystore.jks") + storePassword "Test@123" + keyAlias "my-key" + keyPassword "Test@123" + } } } buildTypes { diff --git a/tools/fallback-release-keystore.jks b/tools/fallback-release-keystore.jks new file mode 100644 index 000000000000..53d3dbc4bc40 Binary files /dev/null and b/tools/fallback-release-keystore.jks differ