forked from MikuLXK/MoRanJiangHu
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.42 KB
/
android.yml
File metadata and controls
61 lines (48 loc) · 1.42 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
name: Build Android APK
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
packages: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install --ignore-scripts --no-fund --no-audit
- name: Build Web App
run: node node_modules/vite/bin/vite.js build
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.VITE_GITHUB_CLIENT_ID }}
- name: Sync Capacitor
run: node node_modules/@capacitor/cli/bin/capacitor sync android
env:
CI: true
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Accept Android Licenses
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses 2>/dev/null || true
- name: Build Debug APK
run: |
cd android
chmod +x gradlew
./gradlew assembleDebug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: moran-jianghu-debug-apk
path: android/app/build/outputs/apk/debug/app-debug.apk
retention-days: 7