diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 3967023..b3b5a37 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,10 +1,9 @@ -name: Android CI +name: Build Android App on: + workflow_dispatch: # 手动触发 push: - branches: [ "release" ] - pull_request: - branches: [ "release" ] + branches: [ main ] # 如果需要自动触发,可以在这里指定分支 jobs: build: @@ -12,15 +11,28 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v4 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: java-version: '11' distribution: 'temurin' - cache: gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Grant execute permissions to gradlew + run: chmod +x ./gradlew + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + with: + android-version: '34' # 指定 SDK 版本 + - name: Build with Gradle - run: ./gradlew build + run: ./gradlew assembleDebug + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: app-debug + path: app/build/outputs/apk/debug/app-debug.apk