Skip to content

Commit

Permalink
Update android.yml
Browse files Browse the repository at this point in the history
Signed-off-by: 益生君 <[email protected]>
  • Loading branch information
YiShengJunn authored Aug 25, 2024
1 parent 94f25fb commit 1594e9a
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
name: Android CI
name: Build Android App

on:
workflow_dispatch: # 手动触发
push:
branches: [ "release" ]
pull_request:
branches: [ "release" ]
branches: [ main ] # 如果需要自动触发,可以在这里指定分支

jobs:
build:

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

0 comments on commit 1594e9a

Please sign in to comment.