From d60bf7d8c5edc4212953f16e988187b470143c40 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Mon, 3 Jan 2022 11:58:50 +0100 Subject: [PATCH] Fix #3: Test, Build, Sign and push to GH releases --- .github/workflows/android.yml | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..457a4782 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,75 @@ +name: Build & Publish Release APK + +on: + push: + branches: + - '*' + tags: + - '*' + +jobs: + build: + name: Build/Test APK + runs-on: ubuntu-latest + steps: + + - name: checkout code + uses: actions/checkout@v2 + + - name: setup jdk + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: 11 + + - name: Run Tests + run: cd obv_messenger/ && ./gradlew test --stacktrace + + - name: Build Release APK + run: cd obv_messenger/ && ./gradlew assembleRelease --stacktrace + + - name: Rename APK + run: mv obv_messenger/app/build/outputs/apk/prod/release/app-prod-release-unsigned.apk Olvid.apk + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: apk + path: Olvid.apk + + release: + name: Sign/Release APK + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + + - name: Download APK from build + uses: actions/download-artifact@v2 + with: + name: apk + + - name: setup jdk + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: 11 + + - name: Sign APK + uses: r0adkll/sign-android-release@v1 + id: sign_app + with: + releaseDirectory: . + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: "32.0.0" + + - name: Upload Release APK + uses: softprops/action-gh-release@v1 + with: + files: | + Olvid.apk + ${{steps.sign_app.outputs.signedReleaseFile}}