Skip to content

Commit

Permalink
CI: automate release (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Surendrajat authored May 14, 2024
1 parent f947198 commit e8ffc4d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: ci
on:
push:
branches: [master]
tags:
- "*"
pull_request:
branches: [master]

jobs:
build:
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
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
Expand All @@ -24,9 +25,39 @@ jobs:
cache: gradle
- name: Set up CMake and Ninja
uses: lukka/get-cmake@latest
- name: Build with Gradle
- 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

release:
if: startsWith(github.ref, 'refs/tags/')
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 (Release)
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
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: app/release/app-release.apk
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/build
/build
/release
*.o
10 changes: 10 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ android {

}

signingConfigs {
release {
storeFile file("../release.keystore")
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias "knoxvnc"
keyPassword System.getenv("KEYSTORE_PASSWORD")
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

Expand Down

0 comments on commit e8ffc4d

Please sign in to comment.