2
2
name : Build Client
3
3
4
4
# Workflow's trigger
5
- # 在创建标签的时候打包
5
+ # Pack when creating tags
6
6
on :
7
7
push :
8
8
tags :
9
9
- v*
10
10
11
11
# Workflow's jobs
12
- # 一共需要3台电脑运行
12
+ # A total of 3 computers are required to run
13
13
# windows
14
14
# macos-latest x86_64
15
15
# macos-latest arm64
@@ -31,21 +31,21 @@ jobs:
31
31
- name : Check out git repository
32
32
uses : actions/checkout@main
33
33
34
- # 获取版本号 workflow不支持 所以用插件
34
+ # Obtaining the version number is not supported by workflow, so a plug-in is used.
35
35
- name : Create version
36
36
id : chat2db_version
37
37
38
38
with :
39
39
value : ${{ github.ref }}
40
40
index_of_str : " refs/tags/v"
41
41
42
- # 输出基础信息
42
+ # Output basic information
43
43
- name : Print basic information
44
44
run : |
45
45
echo "current environment: ${{ env.CHAT2DB_ENVIRONMENT }}"
46
46
echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
47
47
48
- # 安装jre Windows
48
+ # Install jre Windows
49
49
- name : Install Jre for Windows
50
50
if : ${{ runner.os == 'Windows' }}
51
51
uses : actions/setup-java@main
@@ -54,16 +54,17 @@ jobs:
54
54
distribution : " temurin"
55
55
java-package : " jre"
56
56
57
- # 安装jre MacOS X64
57
+ # Install jre MacOS X64
58
58
- name : Install Jre MacOS X64
59
59
if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
60
60
uses : actions/setup-java@main
61
61
with :
62
62
java-version : " 17"
63
63
distribution : " temurin"
64
64
java-package : " jre"
65
+ architecture : " x64"
65
66
66
- # 安装jre MacOS arm64
67
+ # Install jre MacOS arm64
67
68
- name : Install Jre MacOS arm64
68
69
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
69
70
uses : actions/setup-java@main
73
74
java-package : " jre"
74
75
architecture : " aarch64"
75
76
76
- # 安装jre Linux
77
+ # Install jre Linux
77
78
- name : Install Jre for Linux
78
79
if : ${{ runner.os == 'Linux' }}
79
80
uses : actions/setup-java@main
@@ -82,58 +83,63 @@ jobs:
82
83
distribution : " temurin"
83
84
java-package : " jre"
84
85
85
- # java.security 开放tls1 Windows
86
+ # java.security open tls1 Windows
86
87
- name : Enable tls1
87
88
if : ${{ runner.os == 'Windows' }}
88
89
run : |
89
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
90
-
91
- # java.security 开放tls1 macOS
90
+ # sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}\conf\security\java.security"
91
+ $filePath = "${{ env.JAVA_HOME }}\conf\security\java.security"
92
+ $content = Get-Content $filePath -Raw
93
+ $updatedContent = $content -replace '^(jdk.tls.disabledAlgorithms=)(.*)( TLSv1, TLSv1.1,)(.*)', '$1$2$4'
94
+ $updatedContent | Set-Content $filePath
95
+ shell : pwsh
96
+
97
+ # java.security open tls1 macOS
92
98
- name : Enable tls1
93
99
if : ${{ runner.os == 'macOS' }}
94
100
run : |
95
101
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
96
102
97
- # 复制jre Windows
103
+ # Copy jre Windows
98
104
- name : Copy Jre for Windows
99
105
if : ${{ runner.os == 'Windows' }}
100
106
run : |
101
107
mkdir chat2db-client/static
102
108
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
103
109
104
- # 复制jre macOS
110
+ # Copy jre macOS
105
111
- name : Copy Jre for macOS
106
112
if : ${{ runner.os == 'macOS' }}
107
113
run : |
108
114
mkdir chat2db-client/static
109
115
cp -r $JAVA_HOME chat2db-client/static/jre
110
116
chmod -R 777 chat2db-client/static/jre/
111
117
112
- # 复制jre Linux
118
+ # Copy jre Linux
113
119
- name : Copy Jre for Linux
114
120
if : ${{ runner.os == 'Linux' }}
115
121
run : |
116
122
mkdir chat2db-client/static
117
123
cp -r $JAVA_HOME chat2db-client/static/jre
118
124
chmod -R 777 chat2db-client/static/jre/
119
125
120
- # 安装node
126
+ # Install node
121
127
- name : Install Node.js
122
128
uses : actions/setup-node@main
123
129
with :
124
130
node-version : 16
125
131
cache : " yarn"
126
132
cache-dependency-path : chat2db-client/yarn.lock
127
133
128
- # 安装java
134
+ # Install java
129
135
- name : Install Java and Maven
130
136
uses : actions/setup-java@main
131
137
with :
132
138
java-version : " 17"
133
139
distribution : " temurin"
134
140
cache : " maven"
135
141
136
- # 构建静态文件信息
142
+ # Build static file information
137
143
- name : Yarn install & build & copy
138
144
run : |
139
145
cd chat2db-client
@@ -145,7 +151,7 @@ jobs:
145
151
yarn
146
152
yarn run build
147
153
148
- # 编译服务端java版本
154
+ # Compile server-side java version
149
155
- name : Build Java
150
156
run : mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
151
157
@@ -160,7 +166,7 @@ jobs:
160
166
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
161
167
cp -r version ./versions/
162
168
163
- # 复制服务端java 到指定位置
169
+ # Copy server-side java to the specified location
164
170
- name : Copy App
165
171
run : |
166
172
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/${{ steps.chat2db_version.outputs.substring }}/static/
@@ -245,14 +251,14 @@ jobs:
245
251
args : " -c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
246
252
release : true
247
253
248
- # 准备要需要的数据 Windows
254
+ # Prepare the required data Windows
249
255
- name : Prepare upload for Windows
250
256
if : runner.os == 'Windows'
251
257
run : |
252
258
mkdir oss_temp_file
253
259
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
254
260
255
- # 准备要需要的数据 MacOS x86_64
261
+ # Prepare the required data MacOS x86_64
256
262
- name : Prepare upload for MacOS x86_64
257
263
if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
258
264
run : |
@@ -265,21 +271,21 @@ jobs:
265
271
cd static/ && zip -r chat2db-server-start.zip ./
266
272
cp -r chat2db-server-start.zip ../../../../oss_temp_file
267
273
268
- # 准备要需要的数据 MacOS arm64
274
+ # Prepare the required data MacOS arm64
269
275
- name : Prepare upload for MacOS arm64
270
276
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
271
277
run : |
272
278
mkdir oss_temp_file
273
279
cp -r chat2db-client/release/*.dmg ./oss_temp_file
274
280
275
- # 准备要需要的数据 Linux
281
+ # Prepare the required data Linux
276
282
- name : Prepare upload for Linux
277
283
if : runner.os == 'Linux'
278
284
run : |
279
285
mkdir oss_temp_file
280
286
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
281
287
282
- # 把文件上传到OSS 方便下载
288
+ # Upload files to OSS for easy downloading
283
289
- name : Set up oss utils
284
290
uses : yizhoumo/setup-ossutil@v1
285
291
with :
@@ -291,7 +297,7 @@ jobs:
291
297
run : |
292
298
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
293
299
294
- # 构建完成通知
300
+ # Build completion notification
295
301
- name : Send dingtalk message for Windows
296
302
if : ${{ runner.os == 'Windows' }}
297
303
uses : ghostoy/dingtalk-action@master
@@ -304,7 +310,7 @@ jobs:
304
310
"text": "# Windows-release-打包完成通知 \n  \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) "
305
311
}
306
312
307
- # 构建完成通知
313
+ # Build completion notification
308
314
- name : Send dingtalk message for MacOS x86_64
309
315
if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
310
316
uses : ghostoy/dingtalk-action@master
@@ -317,7 +323,7 @@ jobs:
317
323
"text": "# MacOS-x86_64-release-打包完成通知 \n  \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) "
318
324
}
319
325
320
- # 构建完成通知
326
+ # Build completion notification
321
327
- name : Send dingtalk message for MacOS arm64
322
328
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
323
329
uses : ghostoy/dingtalk-action@master
@@ -330,7 +336,7 @@ jobs:
330
336
"text": "# MacOS-arm64-release-打包完成通知 \n  \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) "
331
337
}
332
338
333
- # 构建完成通知
339
+ # Build completion notification
334
340
- name : Send dingtalk message for Linux
335
341
if : ${{ runner.os == 'Linux' }}
336
342
uses : ghostoy/dingtalk-action@master
@@ -341,4 +347,4 @@ jobs:
341
347
{
342
348
"title": "Linux-test-打包完成通知",
343
349
"text": "# Linux-test-打包完成通知 \n  \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)"
344
- }
350
+ }
0 commit comments