Skip to content

Commit bafa79b

Browse files
Update andriod1.yml
1 parent 588ead0 commit bafa79b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/andriod1.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
name: Build APK
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches: [ master ] # 仅 master 更新时触发
6-
workflow_dispatch: # 允许手动触发
6+
branches: [ master ]
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout source (含子模块)
13+
# ① 拉代码(含子模块)
14+
- name: Checkout
1415
uses: actions/checkout@v4
1516
with:
1617
submodules: recursive
17-
fetch-depth: 0
1818

19+
# ② 赋可执行权限(必须在同一个 job、同一个工作目录)
20+
- name: Grant execute permission for gradlew
21+
run: chmod +x gradlew
22+
23+
# ③ 安装 JDK
1924
- name: Set up JDK 17
2025
uses: actions/setup-java@v4
2126
with:
2227
distribution: temurin
2328
java-version: 17
2429

25-
- name: Make gradlew executable
26-
run: chmod +x gradlew
30+
# (可选)列一下文件,确认 gradlew 已可执行
31+
- name: Debug - list files
32+
run: ls -l gradlew
2733

34+
# ④ 编译 APK
2835
- name: Build release APK
2936
run: ./gradlew :app_main:assembleRelease
3037

38+
# ⑤ 上传产物
3139
- name: Upload artifact
3240
uses: actions/upload-artifact@v4
3341
with:

0 commit comments

Comments
 (0)