-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.47 KB
/
build.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
53
54
55
56
name: Plugin Build
# 触发条件
on:
# 手动触发
workflow_dispatch:
# 推送时触发
push:
# 环境变量
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 任务
jobs:
build:
# 检查提交信息
if: contains(github.event.head_commit.message, '[skip]') == false
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Gradle Packages
uses: actions/cache@v4
with:
key: ${{ runner.os }}-Build-Cache
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 8
- name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew clean build --refresh-dependencies
- name: Capture Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: outs/
- name: Automatic Releases
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: false
title: "自动构建最新版本"
files: |
outs/*.*