diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..4bd6c97d --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,54 @@ +name: Build and release app + +on: + workflow_dispatch: + push: + tags: + - 'v*.*' + +jobs: + build: + name: Build, sign and release app + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "17" + cache: "gradle" + + - name: Build APK + run: ./gradlew assembleRelease --no-daemon + + - name: Sign APK + uses: ilharp/sign-android-release@v1 + id: sign + with: + signingKey: ${{ secrets.KEYSTORE }} + keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} + keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + + - name: Rename signed APK + run: | + mv "${{ steps.sign.outputs.signedFile }}" "app-release.apk" + + - name: Create changelog + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.changes }} + files: "app-release.apk" + fail_on_unmatched_files: true + make_latest: true