forked from AndroidCoderPeng/DailyTask
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.08 KB
/
android.yml
File metadata and controls
45 lines (37 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Android CI with Debug APK
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# 新增:显式构建 debug APK
- name: Build Debug APK
run: ./gradlew assembleDebug
# 新增:收集所有 APK 文件到临时目录
- name: Collect APKs
run: |
mkdir -p ./apk_outputs
find . -name "*.apk" -exec cp {} ./apk_outputs/ \;
# 修改:上传所有收集到的 APK 到 Artifacts
- name: Upload APK Artifacts
uses: actions/upload-artifact@v4
with:
name: android-debug-apks
path: ./apk_outputs/**/*
retention-days: 5 # 保留5天自动清理
# 保留原有完整构建(可选,根据需要启用)
# - name: Full Build with Tests
# run: ./gradlew build