mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
add GA for android
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
name: Android Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
android-build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
- name: Install NDK
|
||||
run: |
|
||||
sdkmanager "ndk;25.1.8937393"
|
||||
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/25.1.8937393" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache Gradle packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x android/gradlew
|
||||
|
||||
- name: Build Debug APK
|
||||
run: |
|
||||
cd android
|
||||
./gradlew assembleDebug
|
||||
|
||||
- name: Build Release APK
|
||||
run: |
|
||||
cd android
|
||||
./gradlew assembleRelease
|
||||
|
||||
- name: Upload Debug APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: torch-converter-debug
|
||||
path: android/app/build/outputs/apk/debug/app-debug.apk
|
||||
retention-days: 30
|
||||
|
||||
- name: Upload Release APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: torch-converter-release
|
||||
path: android/app/build/outputs/apk/release/app-release.apk
|
||||
retention-days: 30
|
||||
|
||||
- name: APK Info
|
||||
run: |
|
||||
echo "Debug APK size: $(du -h android/app/build/outputs/apk/debug/app-debug.apk | cut -f1)"
|
||||
echo "Release APK size: $(du -h android/app/build/outputs/apk/release/app-release.apk | cut -f1)"
|
||||
Reference in New Issue
Block a user