-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Create Release build CI action
This builds VisionCamera Example as an .apk and uploads it to the GitHub release artefact.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build Android (Release) | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build_release: | ||
name: Build Android Example App (release) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: 17 | ||
java-package: jdk | ||
|
||
- uses: oven-sh/setup-bun@v2 | ||
|
||
- name: Install npm dependencies (bun) | ||
run: bun install | ||
|
||
- name: Restore Gradle cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
key: ${{ runner.os }}-with-fps-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-with-fps-gradle- | ||
- name: Run Gradle Build for example/android/ | ||
run: cd example/android && ./gradlew assembleRelease --no-daemon --build-cache | ||
|
||
- name: Upload APK to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: example/android/app/build/outputs/apk/release/app-release.apk | ||
asset_name: "VisionCameraExample-${{ github.event.release.tag_name }}.apk" | ||
asset_content_type: application/vnd.android.package-archive | ||
|
||
# Gradle cache doesn't like daemons | ||
- name: Stop Gradle Daemon | ||
run: cd example/android && ./gradlew --stop |