Skip to content

Commit

Permalink
Improve release process (#17)
Browse files Browse the repository at this point in the history
- Persistent signing key taken from Github secrets
- Make tagged release on every push under SEMVER tag (v0.0.0), make
"latest" release on every push to "main" branch
  • Loading branch information
vertexodessa authored Nov 18, 2024
1 parent 18d1fac commit 63cbbca
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Build
on:
push:
branches:
- master
- 'master'
- 'v*.*.*'
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,17 +18,29 @@ jobs:
with:
submodules: recursive

- name: Build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Decode Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > pixelpilot.jks
- name: Build APK
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
sudo apt-get update
sudo apt-get install openjdk-17-jdk
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
keytool -genkeypair -dname CN=OpenIPC -keyalg RSA -validity 8000 -alias fpv -keystore fpv.jks -storepass release -noprompt
./gradlew assembleDebug
mv app/build/outputs/apk/debug/app-debug.apk PixelPilot.apk
./gradlew assembleRelease -Pandroid.injected.signing.store.file=pixelpilot.jks \
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
-Pandroid.injected.signing.key.alias=pixelpilot \
-Pandroid.injected.signing.key.password=$KEYSTORE_PASSWORD
mv app/build/outputs/apk/release/app-release.apk PixelPilot.apk
- name: Upload
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
tag_name: ${{ github.ref_name == 'master' ? 'latest' : github.ref_name }}
files: PixelPilot.apk

0 comments on commit 63cbbca

Please sign in to comment.