From dddad7b91454a9bbfa82e6a00a939b8a5c72ff8e Mon Sep 17 00:00:00 2001 From: Gaurav Ujjwal Date: Wed, 2 Feb 2022 22:10:34 +0530 Subject: [PATCH] Switch to 'release' builds on GitHub Actions Because PRs cannot access GitHub Secrets, they will continue with the debug variant. --- .github/workflows/main.yml | 19 ++++++++++++++----- .github/workflows/pr.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfb48ba..4b6fe39 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,6 @@ name: Android CI on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: build: @@ -23,10 +21,21 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew assembleDebug + run: ./gradlew assembleRelease + + - name: Sign APK + env: + CI_SIGNING_KS: ${{ secrets.CI_SIGNING_KS }} + CI_SIGNING_KS_PASSWORD: ${{ secrets.CI_SIGNING_KS_PASSWORD }} + IN_APK: app-release-unsigned.apk + OUT_APK: app-release.apk + working-directory: ./app/build/outputs/apk/release/ + run: | + echo $CI_SIGNING_KS | base64 --decode > keystore.jks + $ANDROID_HOME/build-tools/30.0.3/apksigner sign --in $IN_APK --out $OUT_APK --ks keystore.jks --ks-pass 'env:CI_SIGNING_KS_PASSWORD' - name: Upload APK uses: actions/upload-artifact@v2 with: - name: dubug-apk - path: app/build/outputs/apk/debug/*.apk \ No newline at end of file + name: avnc-ci + path: app/build/outputs/apk/release/app-release.apk \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..e89a35d --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,29 @@ +name: Android CI + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: true + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew assembleDebug + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: avnc-debug + path: app/build/outputs/apk/debug/*.apk \ No newline at end of file