-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.59 KB
/
tagpush.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
name: tag push
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 获取信息
id: get_info
run: |
echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT
- name: 拉取代码
uses: actions/checkout@v4.1.6
- name: 安装java8
uses: actions/setup-java@v4.2.1
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: 构建
run: |
mvn -B package --file pom.xml
mkdir staging && cp target/*.jar staging
- name: 收集构建文件
uses: actions/upload-artifact@v4.3.3
with:
name: ${{ steps.get_info.outputs.repository_name }}-Release-${{ steps.get_info.outputs.VERSION }}
path: staging
- name: 发布新版本
uses: ncipollo/release-action@v1.14.0
with:
tag: ${{ steps.get_info.outputs.VERSION }}
name: ${{ steps.get_info.outputs.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
bodyFile: ./docs/changelogs/${{ steps.get_info.outputs.VERSION }}.md
artifacts: ./staging/*.*
#这个暂时没有用
# - name: 发布至minebbs
# uses: engsr6982/upload-minebbs@v1.2.0
# with:
# minebbs_token: ${{ secrets.MINEBBS_TOKEN }}
# resource_id: "12345"
# upload_file: ./staging/*.*
# update_title: ${{ steps.get_info.outputs.VERSION }}
# update_version: ${{ steps.get_info.outputs.VERSION }}