Repository navigation
64 lines (56 loc) · 1.77 KB
/
Copy pathbuild-android-release.yml
File metadata and controls
64 lines (56 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build Android (Release)
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Existing GitHub release tag for the APK"
required: true
type: string
workflow_call:
inputs:
tag:
required: true
type: string
permissions:
contents: write
jobs:
build:
name: Build Android Example App (release)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.tag || github.event.release.tag_name || github.sha }}
- uses: oven-sh/setup-bun@v2
- name: Install npm dependencies (bun)
run: bun install
- name: Setup JDK 17
uses: actions/setup-java@v6
with:
distribution: "zulu"
java-version: 17
java-package: jdk
- name: Restore Gradle cache
uses: actions/cache@v6
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
working-directory: example/android
run: ./gradlew assembleRelease --no-daemon --build-cache
- name: Upload APK to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ inputs.tag || github.event.release.tag_name }}" \
example/android/app/build/outputs/apk/release/app-release.apk#NitroSQLiteExample-${{ inputs.tag || github.event.release.tag_name }}.apk \
--clobber
# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: example/android
run: ./gradlew --stop