Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fallback-release-keystore.jks file as a fallback for release builds #17961

Merged
merged 4 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/workflows/tests_emulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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)
16 changes: 12 additions & 4 deletions AnkiDroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Binary file added tools/fallback-release-keystore.jks
Binary file not shown.
Loading