52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: lobe-chat-android
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Android App
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Step 1: Checkout the repository
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
|
|
# Step 2: Set up JDK (Java 11 is used for Android projects)
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '11'
|
|
|
|
# Step 3: Cache Gradle dependencies
|
|
- name: Cache Gradle packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
# Step 4: Download Dependencies (Gradle Wrapper)
|
|
- name: Download Dependencies
|
|
run: ./gradlew --no-daemon clean build
|
|
|
|
# Step 5: Build APK
|
|
- name: Build Debug APK
|
|
run: ./gradlew --no-daemon assembleDebug
|
|
|
|
# Step 6: Upload artifact (optional)
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: app-debug.apk
|
|
path: app/build/outputs/apk/debug/app-debug.apk
|