Skip to content

CI: automate release #12

CI: automate release

CI: automate release #12

Workflow file for this run

name: ci
on:
push:
branches: [master]
tags:
- "*"
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set up CMake and Ninja
uses: lukka/get-cmake@latest
- name: Build with Gradle (Debug)
run: ./gradlew clean && ./gradlew assembleDebug
- uses: actions/upload-artifact@v4
with:
name: knoxvnc-debug.apk
path: app/build/outputs/apk/debug/app-debug.apk
- name: Build with Gradle (Release)
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
KEYSTORE_BASE64: secrets.KEYSTORE_BASE64
KEYSTORE_PASSWORD: secrets.KEYSTORE_PASSWORD
run: |
echo $KEYSTORE_BASE64 | base64 --decode > release.keystore
./gradlew clean && ./gradlew assembleRelease
- name: Get release version
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: app/release/app-release.apk