36 lines
799 B
YAML
36 lines
799 B
YAML
name: Android Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main ]
|
|
pull_request:
|
|
branches: [ master, main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: android
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17 (ARM64)
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
architecture: 'arm64' # 强制使用 ARM64 架构
|
|
|
|
- name: Build with Gradle
|
|
run: |
|
|
# 直接使用 gradle 命令,不使用 wrapper
|
|
gradle wrapper --gradle-version 8.2
|
|
./gradlew assembleDebug --no-daemon --stacktrace
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-debug
|
|
path: app/build/outputs/apk/debug/app-debug.apk
|