Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve release process #17

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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