-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 1.77 KB
/
Copy pathbuild-android.yml
File metadata and controls
71 lines (58 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
65
66
67
68
69
70
71
name: Build Android APK
on:
push:
branches: [main]
tags:
- 'v*'
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install dependencies
run: npm ci
- name: Build web app
run: npm run build
# Skip cap sync - assets are pre-committed to avoid regeneration issues
- name: Copy web assets to Android
run: |
cp -r dist/* android/app/src/main/assets/public/
- name: Build Debug APK
working-directory: android
run: chmod +x gradlew && ./gradlew assembleDebug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: wg-field-validator-debug
path: android/app/build/outputs/apk/debug/app-debug.apk
retention-days: 30
- name: Create Release APK (on tag)
if: startsWith(github.ref, 'refs/tags/')
working-directory: android
run: ./gradlew assembleRelease
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
android/app/build/outputs/apk/debug/app-debug.apk
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}