forked from NguyenDuck/blocktopograph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |