-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.07 KB
/
build-debug-apk.yml
File metadata and controls
78 lines (64 loc) · 2.07 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
72
73
74
75
76
77
78
name: Build Debug APK (no signing required)
# Produces an installable, debug-signed APK that wraps the live web app at
# https://spendwisev2.vercel.app. No Play Console account, no keystore, no
# secrets needed. Trigger from the Actions tab and download from "Artifacts".
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'web/**'
- '.github/workflows/build-debug-apk.yml'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: web
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Setup Java 21
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
# Note: we don't run `npm run build` because the Capacitor wrapper loads
# the live web app from https://spendwisev2.vercel.app — nothing local
# is shipped inside the APK. We just need a non-empty dist/ folder for
# `npx cap sync` to be happy.
- name: Create placeholder dist
run: |
mkdir -p dist
echo '<!doctype html><meta charset="utf-8"><title>SpendWise</title>' > dist/index.html
- name: Sync Capacitor
run: npx cap sync android
- name: Build debug APK
working-directory: web/android
run: |
chmod +x gradlew
./gradlew assembleDebug
- name: Stage APK
run: |
mkdir -p out
cp android/app/build/outputs/apk/debug/app-debug.apk \
out/SpendWise-debug-${GITHUB_SHA::7}.apk
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: SpendWise-debug-apk
path: web/out/*.apk
if-no-files-found: error