diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 376a405..a5b8f5c 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -6,7 +6,7 @@ on: paths: - android/** - .github/workflows/* - + pull_request: branches: [ "main" ] paths: @@ -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 @@ -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') }} @@ -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 }} diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 0f165a6..813933d 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -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") @@ -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")