22name : Build Client
33
44# Workflow's trigger
5- # 在创建标签的时候打包
5+ # Pack when creating tags
66on :
77 push :
88 tags :
99 - v*
1010
1111# Workflow's jobs
12- # 一共需要3台电脑运行
12+ # A total of 3 computers are required to run
1313# windows
1414# macos-latest x86_64
1515# macos-latest arm64
@@ -31,21 +31,21 @@ jobs:
3131 - name : Check out git repository
3232 uses : actions/checkout@main
3333
34- # 获取版本号 workflow不支持 所以用插件
34+ # Obtaining the version number is not supported by workflow, so a plug-in is used.
3535 - name : Create version
3636 id : chat2db_version
37373838 with :
3939 value : ${{ github.ref }}
4040 index_of_str : " refs/tags/v"
4141
42- # 输出基础信息
42+ # Output basic information
4343 - name : Print basic information
4444 run : |
4545 echo "current environment: ${{ env.CHAT2DB_ENVIRONMENT }}"
4646 echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
4747
48- # 安装jre Windows
48+ # Install jre Windows
4949 - name : Install Jre for Windows
5050 if : ${{ runner.os == 'Windows' }}
5151 uses : actions/setup-java@main
@@ -54,16 +54,17 @@ jobs:
5454 distribution : " temurin"
5555 java-package : " jre"
5656
57- # 安装jre MacOS X64
57+ # Install jre MacOS X64
5858 - name : Install Jre MacOS X64
5959 if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
6060 uses : actions/setup-java@main
6161 with :
6262 java-version : " 17"
6363 distribution : " temurin"
6464 java-package : " jre"
65+ architecture : " x64"
6566
66- # 安装jre MacOS arm64
67+ # Install jre MacOS arm64
6768 - name : Install Jre MacOS arm64
6869 if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
6970 uses : actions/setup-java@main
7374 java-package : " jre"
7475 architecture : " aarch64"
7576
76- # 安装jre Linux
77+ # Install jre Linux
7778 - name : Install Jre for Linux
7879 if : ${{ runner.os == 'Linux' }}
7980 uses : actions/setup-java@main
@@ -82,58 +83,63 @@ jobs:
8283 distribution : " temurin"
8384 java-package : " jre"
8485
85- # java.security 开放tls1 Windows
86+ # java.security open tls1 Windows
8687 - name : Enable tls1
8788 if : ${{ runner.os == 'Windows' }}
8889 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
9298 - name : Enable tls1
9399 if : ${{ runner.os == 'macOS' }}
94100 run : |
95101 sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
96102
97- # 复制jre Windows
103+ # Copy jre Windows
98104 - name : Copy Jre for Windows
99105 if : ${{ runner.os == 'Windows' }}
100106 run : |
101107 mkdir chat2db-client/static
102108 cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
103109
104- # 复制jre macOS
110+ # Copy jre macOS
105111 - name : Copy Jre for macOS
106112 if : ${{ runner.os == 'macOS' }}
107113 run : |
108114 mkdir chat2db-client/static
109115 cp -r $JAVA_HOME chat2db-client/static/jre
110116 chmod -R 777 chat2db-client/static/jre/
111117
112- # 复制jre Linux
118+ # Copy jre Linux
113119 - name : Copy Jre for Linux
114120 if : ${{ runner.os == 'Linux' }}
115121 run : |
116122 mkdir chat2db-client/static
117123 cp -r $JAVA_HOME chat2db-client/static/jre
118124 chmod -R 777 chat2db-client/static/jre/
119125
120- # 安装node
126+ # Install node
121127 - name : Install Node.js
122128 uses : actions/setup-node@main
123129 with :
124130 node-version : 16
125131 cache : " yarn"
126132 cache-dependency-path : chat2db-client/yarn.lock
127133
128- # 安装java
134+ # Install java
129135 - name : Install Java and Maven
130136 uses : actions/setup-java@main
131137 with :
132138 java-version : " 17"
133139 distribution : " temurin"
134140 cache : " maven"
135141
136- # 构建静态文件信息
142+ # Build static file information
137143 - name : Yarn install & build & copy
138144 run : |
139145 cd chat2db-client
@@ -145,7 +151,7 @@ jobs:
145151 yarn
146152 yarn run build
147153
148- # 编译服务端java版本
154+ # Compile server-side java version
149155 - name : Build Java
150156 run : mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
151157
@@ -160,7 +166,7 @@ jobs:
160166 echo -n ${{ steps.chat2db_version.outputs.substring }} > version
161167 cp -r version ./versions/
162168
163- # 复制服务端java 到指定位置
169+ # Copy server-side java to the specified location
164170 - name : Copy App
165171 run : |
166172 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:
245251 args : " -c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
246252 release : true
247253
248- # 准备要需要的数据 Windows
254+ # Prepare the required data Windows
249255 - name : Prepare upload for Windows
250256 if : runner.os == 'Windows'
251257 run : |
252258 mkdir oss_temp_file
253259 cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
254260
255- # 准备要需要的数据 MacOS x86_64
261+ # Prepare the required data MacOS x86_64
256262 - name : Prepare upload for MacOS x86_64
257263 if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
258264 run : |
@@ -265,21 +271,21 @@ jobs:
265271 cd static/ && zip -r chat2db-server-start.zip ./
266272 cp -r chat2db-server-start.zip ../../../../oss_temp_file
267273
268- # 准备要需要的数据 MacOS arm64
274+ # Prepare the required data MacOS arm64
269275 - name : Prepare upload for MacOS arm64
270276 if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
271277 run : |
272278 mkdir oss_temp_file
273279 cp -r chat2db-client/release/*.dmg ./oss_temp_file
274280
275- # 准备要需要的数据 Linux
281+ # Prepare the required data Linux
276282 - name : Prepare upload for Linux
277283 if : runner.os == 'Linux'
278284 run : |
279285 mkdir oss_temp_file
280286 cp -r chat2db-client/release/*.AppImage ./oss_temp_file
281287
282- # 把文件上传到OSS 方便下载
288+ # Upload files to OSS for easy downloading
283289 - name : Set up oss utils
284290 uses : yizhoumo/setup-ossutil@v1
285291 with :
@@ -291,7 +297,7 @@ jobs:
291297 run : |
292298 ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
293299
294- # 构建完成通知
300+ # Build completion notification
295301 - name : Send dingtalk message for Windows
296302 if : ${{ runner.os == 'Windows' }}
297303 uses : ghostoy/dingtalk-action@master
@@ -304,7 +310,7 @@ jobs:
304310 "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) "
305311 }
306312
307- # 构建完成通知
313+ # Build completion notification
308314 - name : Send dingtalk message for MacOS x86_64
309315 if : ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
310316 uses : ghostoy/dingtalk-action@master
@@ -317,7 +323,7 @@ jobs:
317323 "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) "
318324 }
319325
320- # 构建完成通知
326+ # Build completion notification
321327 - name : Send dingtalk message for MacOS arm64
322328 if : ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
323329 uses : ghostoy/dingtalk-action@master
@@ -330,7 +336,7 @@ jobs:
330336 "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) "
331337 }
332338
333- # 构建完成通知
339+ # Build completion notification
334340 - name : Send dingtalk message for Linux
335341 if : ${{ runner.os == 'Linux' }}
336342 uses : ghostoy/dingtalk-action@master
@@ -341,4 +347,4 @@ jobs:
341347 {
342348 "title": "Linux-test-打包完成通知",
343349 "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