2
2
name : Build Client
3
3
4
4
# Workflow's trigger
5
- # Pack when creating tags
5
+ # 在创建标签的时候打包
6
6
on :
7
7
push :
8
8
tags :
9
9
- v*
10
10
11
11
# Workflow's jobs
12
- # A total of 3 computers are required to run
12
+ # 一共需要3台电脑运行
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
- # Obtaining the version number is not supported by workflow, so a plug-in is used.
34
+ # 获取版本号 workflow不支持 所以用插件
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
- # Output basic information
42
+ # 输出基础信息
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
- # Install jre Windows
48
+ # 安装jre Windows
49
49
- name : Install Jre for Windows
50
50
if : ${{ runner.os == 'Windows' }}
51
51
uses : actions/setup-java@main
54
54
distribution : " temurin"
55
55
java-package : " jre"
56
56
57
- # Install jre MacOS X64
57
+ # 安装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
63
63
distribution : " temurin"
64
64
java-package : " jre"
65
65
66
- # Install jre MacOS arm64
66
+ # 安装jre MacOS arm64
67
67
- name : Install Jre MacOS arm64
68
68
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
69
69
uses : actions/setup-java@main
73
73
java-package : " jre"
74
74
architecture : " aarch64"
75
75
76
- # Install jre Linux
76
+ # 安装jre Linux
77
77
- name : Install Jre for Linux
78
78
if : ${{ runner.os == 'Linux' }}
79
79
uses : actions/setup-java@main
@@ -82,73 +82,58 @@ jobs:
82
82
distribution : " temurin"
83
83
java-package : " jre"
84
84
85
- # java.security open tls1 Windows
86
- # - name: Enable tls1
87
- # if: ${{ runner.os == 'Windows' }}
88
- # run: |
89
- # sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
90
- # shell: pwsh
91
- #
92
- # # java.security open tls1 macOS
93
- # - name: Enable tls1
94
- # if: ${{ runner.os == 'macOS' }}
95
- # run: |
96
- # sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
97
- # 开放TLS
98
- - name : Enable TLS 1.0 and 1.1 in java.security
85
+ # java.security 开放tls1 Windows
86
+ - name : Enable tls1
87
+ if : ${{ runner.os == 'Windows' }}
88
+ 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
92
+ - name : Enable tls1
93
+ if : ${{ runner.os == 'macOS' }}
99
94
run : |
100
- if [ "$RUNNER_OS" = "Windows" ]; then
101
- sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
102
- elif [ "$RUNNER_OS" = "Linux" ]; then
103
- sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
104
- elif [ "$RUNNER_OS" = "macOS" ]; then
105
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
106
- fi
107
- shell : bash
108
- env :
109
- RUNNER_OS : ${{ runner.os }}
110
- JAVA_HOME : ${{ env.JAVA_HOME }}
111
-
112
- # Copy jre Windows
95
+ sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
96
+
97
+ # 复制jre Windows
113
98
- name : Copy Jre for Windows
114
99
if : ${{ runner.os == 'Windows' }}
115
100
run : |
116
101
mkdir chat2db-client/static
117
102
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
118
103
119
- # Copy jre macOS
104
+ # 复制jre macOS
120
105
- name : Copy Jre for macOS
121
106
if : ${{ runner.os == 'macOS' }}
122
107
run : |
123
108
mkdir chat2db-client/static
124
109
cp -r $JAVA_HOME chat2db-client/static/jre
125
110
chmod -R 777 chat2db-client/static/jre/
126
111
127
- # Copy jre Linux
112
+ # 复制jre Linux
128
113
- name : Copy Jre for Linux
129
114
if : ${{ runner.os == 'Linux' }}
130
115
run : |
131
116
mkdir chat2db-client/static
132
117
cp -r $JAVA_HOME chat2db-client/static/jre
133
118
chmod -R 777 chat2db-client/static/jre/
134
119
135
- # Install node
120
+ # 安装node
136
121
- name : Install Node.js
137
122
uses : actions/setup-node@main
138
123
with :
139
124
node-version : 16
140
125
cache : " yarn"
141
126
cache-dependency-path : chat2db-client/yarn.lock
142
127
143
- # Install java
128
+ # 安装java
144
129
- name : Install Java and Maven
145
130
uses : actions/setup-java@main
146
131
with :
147
132
java-version : " 17"
148
133
distribution : " temurin"
149
134
cache : " maven"
150
135
151
- # Build static file information
136
+ # 构建静态文件信息
152
137
- name : Yarn install & build & copy
153
138
run : |
154
139
cd chat2db-client
@@ -160,7 +145,7 @@ jobs:
160
145
yarn
161
146
yarn run build
162
147
163
- # Compile server-side java version
148
+ # 编译服务端java版本
164
149
- name : Build Java
165
150
run : mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
166
151
@@ -175,7 +160,7 @@ jobs:
175
160
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
176
161
cp -r version ./versions/
177
162
178
- # Copy server-side java to the specified location
163
+ # 复制服务端java 到指定位置
179
164
- name : Copy App
180
165
run : |
181
166
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/${{ steps.chat2db_version.outputs.substring }}/static/
@@ -220,7 +205,7 @@ jobs:
220
205
run : |
221
206
xcrun notarytool store-credentials "Chat2DB" --apple-id "${{secrets.MAC_APPLE_ID}}" --password "${{secrets.MAC_APPLE_PASSWORD}}" --team-id "${{secrets.MAC_TEAM_ID}}"
222
207
xcrun notarytool submit chat2db-client/release/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg --keychain-profile "Chat2DB"
223
-
208
+
224
209
# macos arm64
225
210
- name : Build/release Electron app for MacOS arm64
226
211
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
@@ -260,14 +245,14 @@ jobs:
260
245
args : " -c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
261
246
release : true
262
247
263
- # Prepare the required data Windows
248
+ # 准备要需要的数据 Windows
264
249
- name : Prepare upload for Windows
265
250
if : runner.os == 'Windows'
266
251
run : |
267
252
mkdir oss_temp_file
268
253
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
269
254
270
- # Prepare the required data MacOS x86_64
255
+ # 准备要需要的数据 MacOS x86_64
271
256
- name : Prepare upload for MacOS x86_64
272
257
if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
273
258
run : |
@@ -280,21 +265,21 @@ jobs:
280
265
cd static/ && zip -r chat2db-server-start.zip ./
281
266
cp -r chat2db-server-start.zip ../../../../oss_temp_file
282
267
283
- # Prepare the required data MacOS arm64
268
+ # 准备要需要的数据 MacOS arm64
284
269
- name : Prepare upload for MacOS arm64
285
270
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
286
271
run : |
287
272
mkdir oss_temp_file
288
273
cp -r chat2db-client/release/*.dmg ./oss_temp_file
289
274
290
- # Prepare the required data Linux
275
+ # 准备要需要的数据 Linux
291
276
- name : Prepare upload for Linux
292
277
if : runner.os == 'Linux'
293
278
run : |
294
279
mkdir oss_temp_file
295
280
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
296
281
297
- # Upload files to OSS for easy downloading
282
+ # 把文件上传到OSS 方便下载
298
283
- name : Set up oss utils
299
284
uses : yizhoumo/setup-ossutil@v1
300
285
with :
@@ -306,7 +291,7 @@ jobs:
306
291
run : |
307
292
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
308
293
309
- # Build completion notification
294
+ # 构建完成通知
310
295
- name : Send dingtalk message for Windows
311
296
if : ${{ runner.os == 'Windows' }}
312
297
uses : ghostoy/dingtalk-action@master
@@ -319,7 +304,7 @@ jobs:
319
304
"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) "
320
305
}
321
306
322
- # Build completion notification
307
+ # 构建完成通知
323
308
- name : Send dingtalk message for MacOS x86_64
324
309
if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
325
310
uses : ghostoy/dingtalk-action@master
@@ -332,7 +317,7 @@ jobs:
332
317
"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) "
333
318
}
334
319
335
- # Build completion notification
320
+ # 构建完成通知
336
321
- name : Send dingtalk message for MacOS arm64
337
322
if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
338
323
uses : ghostoy/dingtalk-action@master
@@ -345,7 +330,7 @@ jobs:
345
330
"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) "
346
331
}
347
332
348
- # Build completion notification
333
+ # 构建完成通知
349
334
- name : Send dingtalk message for Linux
350
335
if : ${{ runner.os == 'Linux' }}
351
336
uses : ghostoy/dingtalk-action@master
0 commit comments