forked from aaa1115910/bv
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.1 KB
/
main.yml
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
46
47
48
49
50
51
52
name: 构建 Android 应用
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 设置 Java 环境
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: 安装依赖
run: |
sudo apt update
sudo apt install -y apktool signapk
- name: 赋予脚本执行权限
run: chmod +x build.sh
- name: 构建应用
run: ./build.sh
# 将构建产物保存为工件,方便下载
- name: 保存构建产物
uses: actions/upload-artifact@v2
with:
name: app-build
# 修改路径,指向生成的 mybv.apk 文件
path: mybv.apk
# 添加一个新的 job 来下载构建产物
download:
needs: build # 确保 build job 完成后再运行
runs-on: ubuntu-latest
steps:
- name: 下载构建产物
uses: actions/download-artifact@v2
with:
name: app-build
# 下载后,您可以在 Actions 页面找到该工件并下载