Skip to content

Commit

Permalink
Pass keystore path as env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nain-F49FF806 committed Jul 11, 2024
1 parent 83117a0 commit 0a1a145
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- android/**
- .github/workflows/*

pull_request:
branches: [ "main" ]
paths:
Expand All @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: source submodules
run: git submodule update --init
run: git submodule update --init

- name: set up JDK 17
uses: actions/setup-java@v3
Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
if: ${{ (github.event_name == 'release') }}
env:
SIGNING_STORE_BASE64: ${{ secrets.SIGNING_STORE_BASE64 }}
TMP_DIR: ${{ runner.temp }}
run: |
KEYSTORE_DIR="/keystore/"
mkdir -p "${KEYSTORE_DIR}"
echo ${SIGNING_STORE_BASE64} | base64 -d > "${KEYSTORE_DIR}"/keystore.jks
SIGNING_STORE_FILE_PATH="${TMP_DIR}/keystore.jks"
echo ${SIGNING_STORE_BASE64} | base64 -d > ${SIGNING_STORE_FILE_PATH}
- name: Change gradle signing config to github release
if: ${{ (github.event_name == 'release') }}
Expand All @@ -83,6 +83,7 @@ jobs:
working-directory: android/
run: ./gradlew build assembleSource-originalRelease
env:
SIGNING_STORE_FILE_PATH: ${{ runner.temp }}/keystore.jks
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
Expand Down
5 changes: 2 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
applicationId = "alt.nainapps.sharepaste"
minSdk = 26
targetSdk = 34
versionCode = 1720687000
versionCode = 1720700000
versionName = "2024.07.11"
setProperty("archivesBaseName", "sharepaste.oo")

Expand All @@ -40,8 +40,7 @@ android {

signingConfigs {
create("github") {
val keystorePath = "/keystore/keystore.jks"
storeFile = File(keystorePath)
storeFile = file(System.getenv("SIGNING_STORE_FILE_PATH") ?: "keystore.jks")
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
Expand Down

0 comments on commit 0a1a145

Please sign in to comment.