-
Notifications
You must be signed in to change notification settings - Fork 227
34 lines (28 loc) · 1.25 KB
/
Copy pathandroid.yml
File metadata and controls
34 lines (28 loc) · 1.25 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
# workflow的名称,会显示在github 的项目的Actions的右边列表中,如下图
name: Android CI
# 在满足以下条件触发这个workflow
on:
push:
# 在指定的远程分支 master上,发生推送时
branches: [ master ]
jobs:
# 多个job,如果有多个,每个以“-”开头,这里只有一个 job
build:
runs-on: ubuntu-latest # 该job 运行的系统环境,支持ubuntu 、windows、macOS
# 下面是多个step ,每个以“-”开头
steps:
- uses: actions/checkout@v2 # step:检查分支
- name: set up JDK 1.8 # step:设置jdk版本
uses: actions/setup-java@v1 # 引用公共action
with:
java-version: 1.8
- name: Build with Gradle # step:打包apk
# 运行打包命令
run: chmod +x gradlew &&./gradlew assembleRelease
#step:上传apk 到action,在右上角查看
# 官方文档 https://help.github.com/cn/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts#uploading-build-and-test-artifacts
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/release/app-release.apk