Skip to content

Commit

Permalink
Test, Build, Sign and push to GH releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kumy committed Jan 3, 2022
1 parent 51af074 commit ae9f4d9
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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-unsigned.apk

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
path: Olvid-unsigned.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: ${{steps.sign_app.outputs.signedReleaseFile}}

0 comments on commit ae9f4d9

Please sign in to comment.