Files
android-ci-demo/.gitea/workflows/android-build.yml
T
2026-06-02 10:07:18 +08:00

45 lines
1003 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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'
- name: Install Gradle
run: |
# Alpine Linux 使用 apkDebian/Ubuntu 使用 apt-get
if command -v apk &> /dev/null; then
apk add --no-cache gradle
else
apt-get update && apt-get install -y gradle
fi
gradle --version
- name: Build with Gradle
run: |
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