-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (134 loc) · 4.66 KB
/
Copy pathrelease.yml
File metadata and controls
144 lines (134 loc) · 4.66 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: release packet
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
# 检出代码并包含标签
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download ubuntu build
uses: dawidd6/action-download-artifact@v24
with:
workflow: Ubuntu_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download fedora build
uses: dawidd6/action-download-artifact@v24
with:
workflow: fedora_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download debian build
uses: dawidd6/action-download-artifact@v24
with:
workflow: debian_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download Alma
uses: dawidd6/action-download-artifact@v24
with:
workflow: Alma_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download Centos
uses: dawidd6/action-download-artifact@v24
with:
workflow: Centos_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download Rockylinux
uses: dawidd6/action-download-artifact@v24
with:
workflow: Rocky_build.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download mint
uses: dawidd6/action-download-artifact@v24
with:
workflow: Mintbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download macbuild
uses: dawidd6/action-download-artifact@v24
with:
workflow: macbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download msbuild
uses: dawidd6/action-download-artifact@v24
with:
workflow: msbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Display structure of downloaded files
run: ls -al ./XRelease/
- name: Get current version and increment X
id: versioning
run: |
# 获取最新的标签,假设标签形式为 V1.X.0.1001
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $latest_tag"
# 提取 X 的值并递增
major=$(echo $latest_tag | cut -d '.' -f 1)
minor=$(echo $latest_tag | cut -d '.' -f 2)
patch=$(echo $latest_tag | cut -d '.' -f 3)
build=$(echo $latest_tag | cut -d '.' -f 4)
new_minor=$((minor + 1))
new_version="$major.$new_minor.$patch.$build"
echo "New version: $new_version"
echo "new_tag=$new_version" >> $GITHUB_OUTPUT
echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Create and push new tag
run: |
git tag ${{ steps.versioning.outputs.new_tag }}
git push origin ${{ steps.versioning.outputs.new_tag }}
- name: Generate release notes
run: |
logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %H - %s - %an" --no-merges)
release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/')
echo "$release_notes"
echo "$release_notes" > release_notes.txt
- name: Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
tag_name: ${{ steps.versioning.outputs.new_tag }}
name: XEngine_ProxyServiceApp ${{ steps.versioning.outputs.new_tag }}
body_path: release_notes.txt
files: ./XRelease/*.zip