Skip to content

Commit

Permalink
chore: Create Release build CI action
Browse files Browse the repository at this point in the history
This builds VisionCamera Example as an .apk and uploads it to the GitHub release artefact.
  • Loading branch information
mrousavy committed Nov 13, 2024
1 parent 143ec9f commit 4f2c6da
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-android-release.yml
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

0 comments on commit 4f2c6da

Please sign in to comment.