-
Notifications
You must be signed in to change notification settings - Fork 24
198 lines (198 loc) · 9.79 KB
/
create_release.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
on:
push:
tags:
- 'v*'
name: Create Release
env:
tag: ${{ github.ref }}
jobs:
auto-create-release:
name: Auto Create Release
runs-on: windows-latest
steps:
- name: save env version
shell: bash
run: |
str=${{env.tag}}
echo "version=${str##*v}" >> $GITHUB_ENV
- name: Checkout Source # 检出代码
uses: actions/checkout@v3
- name: Set up JDK 8 # 构建jdk运行环境
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Create License Binary Suffix
run: |
mvn license:aggregate-add-third-party
- name: set version
run: |
mvn versions:set -DnewVersion='${{ env.version }}'
- name: Build with Maven
run: |
mvn clean package
- name: copy jars to package dir
run: |
bash scripts/copy_jar.sh ${{ env.version }}
- name: Create Release # 自动发布release版本
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
# 上传release包 ========================
- name: Upload Release dynamic-demo # 上传dynamic-demo release包
id: upload-release-asset-dynamic
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-dynamic-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-dynamic-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release flowcontrol-demo # flowcontrol-demo release包
id: upload-release-asset-flowcontrol
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-flowcontrol-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-flowcontrol-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release grace-demo # grace-demo release包
id: upload-release-asset-grace
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-grace-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-grace-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release load-balance-demo # load-balance-demo release包
id: upload-release-asset-load-balance
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-load-balance-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-load-balance-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release monitor-demo # monitor-demo release包
id: upload-release-asset-monitor
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-monitor-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-monitor-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release router-demo # router-demo release包
id: upload-release-asset-router
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-router-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-router-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release tag-transmission-demo # tag-transmission-demo release包
id: upload-release-asset-tag-transmission
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-tag-transmission-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-tag-transmission-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release registry-demo # registry-demo release包
id: upload-release-asset-registry
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-registry-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-registry-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release springboot-registry-demo # springboot-registry-demo release包
id: upload-release-asset-springboot-registry
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-springboot-registry-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-springboot-registry-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release visibility-demo # visibility-demo release包
id: upload-release-asset-visibility
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-visibility-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-visibility-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release removal-demo # removal-demo release包
id: upload-release-asset-removal
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-removal-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-removal-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release mq-consume-prohibition-demo # mq-consume-prohibition-demo release包
id: upload-release-asset-mq-consume-prohibition
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-mq-consume-prohibition-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-mq-consume-prohibition-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release database-write-prohibition-demo # database-write-prohibition-demo release包
id: upload-release-asset-databse-write-prohibition
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-database-write-prohibition-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-database-write-prohibition-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release first-plugin-demo # first-plugin-demo release包
id: upload-release-asset-first-plugin
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-first-plugin-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-first-plugin-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release xds-service-discovery-demo # xds-service-discovery-demo release包
id: upload-release-asset-xds-service-discovery
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-xds-service-discovery-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-xds-service-discovery-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar