Create android.yml
This commit is contained in:
parent
1e3175db83
commit
654d9581ac
1 changed files with 52 additions and 0 deletions
52
.github/workflows/android.yml
vendored
Normal file
52
.github/workflows/android.yml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue