Skip to content

Commit cb4fb97

Browse files
committed
feat:support download task
1 parent 85b9925 commit cb4fb97

File tree

1 file changed

+37
-52
lines changed

1 file changed

+37
-52
lines changed

.github/workflows/release.yml

+37-52
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
name: Build Client
33

44
# Workflow's trigger
5-
# Pack when creating tags
5+
# 在创建标签的时候打包
66
on:
77
push:
88
tags:
99
- v*
1010

1111
# Workflow's jobs
12-
# A total of 3 computers are required to run
12+
# 一共需要3台电脑运行
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-
# Obtaining the version number is not supported by workflow, so a plug-in is used.
34+
# 获取版本号 workflow不支持 所以用插件
3535
- name: Create version
3636
id: chat2db_version
3737
uses: bhowell2/[email protected]
3838
with:
3939
value: ${{ github.ref }}
4040
index_of_str: "refs/tags/v"
4141

42-
# Output basic information
42+
# 输出基础信息
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-
# Install jre Windows
48+
# 安装jre Windows
4949
- name: Install Jre for Windows
5050
if: ${{ runner.os == 'Windows' }}
5151
uses: actions/setup-java@main
@@ -54,7 +54,7 @@ jobs:
5454
distribution: "temurin"
5555
java-package: "jre"
5656

57-
# Install jre MacOS X64
57+
# 安装jre MacOS X64
5858
- name: Install Jre MacOS X64
5959
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
6060
uses: actions/setup-java@main
@@ -63,7 +63,7 @@ jobs:
6363
distribution: "temurin"
6464
java-package: "jre"
6565

66-
# Install jre MacOS arm64
66+
# 安装jre MacOS arm64
6767
- name: Install Jre MacOS arm64
6868
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
6969
uses: actions/setup-java@main
@@ -73,7 +73,7 @@ jobs:
7373
java-package: "jre"
7474
architecture: "aarch64"
7575

76-
# Install jre Linux
76+
# 安装jre Linux
7777
- name: Install Jre for Linux
7878
if: ${{ runner.os == 'Linux' }}
7979
uses: actions/setup-java@main
@@ -82,73 +82,58 @@ jobs:
8282
distribution: "temurin"
8383
java-package: "jre"
8484

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' }}
9994
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
11398
- name: Copy Jre for Windows
11499
if: ${{ runner.os == 'Windows' }}
115100
run: |
116101
mkdir chat2db-client/static
117102
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
118103
119-
# Copy jre macOS
104+
# 复制jre macOS
120105
- name: Copy Jre for macOS
121106
if: ${{ runner.os == 'macOS' }}
122107
run: |
123108
mkdir chat2db-client/static
124109
cp -r $JAVA_HOME chat2db-client/static/jre
125110
chmod -R 777 chat2db-client/static/jre/
126111
127-
# Copy jre Linux
112+
# 复制jre Linux
128113
- name: Copy Jre for Linux
129114
if: ${{ runner.os == 'Linux' }}
130115
run: |
131116
mkdir chat2db-client/static
132117
cp -r $JAVA_HOME chat2db-client/static/jre
133118
chmod -R 777 chat2db-client/static/jre/
134119
135-
# Install node
120+
# 安装node
136121
- name: Install Node.js
137122
uses: actions/setup-node@main
138123
with:
139124
node-version: 16
140125
cache: "yarn"
141126
cache-dependency-path: chat2db-client/yarn.lock
142127

143-
# Install java
128+
# 安装java
144129
- name: Install Java and Maven
145130
uses: actions/setup-java@main
146131
with:
147132
java-version: "17"
148133
distribution: "temurin"
149134
cache: "maven"
150135

151-
# Build static file information
136+
# 构建静态文件信息
152137
- name: Yarn install & build & copy
153138
run: |
154139
cd chat2db-client
@@ -160,7 +145,7 @@ jobs:
160145
yarn
161146
yarn run build
162147
163-
# Compile server-side java version
148+
# 编译服务端java版本
164149
- name: Build Java
165150
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
166151

@@ -175,7 +160,7 @@ jobs:
175160
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
176161
cp -r version ./versions/
177162
178-
# Copy server-side java to the specified location
163+
# 复制服务端java 到指定位置
179164
- name: Copy App
180165
run: |
181166
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:
220205
run: |
221206
xcrun notarytool store-credentials "Chat2DB" --apple-id "${{secrets.MAC_APPLE_ID}}" --password "${{secrets.MAC_APPLE_PASSWORD}}" --team-id "${{secrets.MAC_TEAM_ID}}"
222207
xcrun notarytool submit chat2db-client/release/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg --keychain-profile "Chat2DB"
223-
208+
224209
# macos arm64
225210
- name: Build/release Electron app for MacOS arm64
226211
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
@@ -260,14 +245,14 @@ jobs:
260245
args: "-c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
261246
release: true
262247

263-
# Prepare the required data Windows
248+
# 准备要需要的数据 Windows
264249
- name: Prepare upload for Windows
265250
if: runner.os == 'Windows'
266251
run: |
267252
mkdir oss_temp_file
268253
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
269254
270-
# Prepare the required data MacOS x86_64
255+
# 准备要需要的数据 MacOS x86_64
271256
- name: Prepare upload for MacOS x86_64
272257
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
273258
run: |
@@ -280,21 +265,21 @@ jobs:
280265
cd static/ && zip -r chat2db-server-start.zip ./
281266
cp -r chat2db-server-start.zip ../../../../oss_temp_file
282267
283-
# Prepare the required data MacOS arm64
268+
# 准备要需要的数据 MacOS arm64
284269
- name: Prepare upload for MacOS arm64
285270
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
286271
run: |
287272
mkdir oss_temp_file
288273
cp -r chat2db-client/release/*.dmg ./oss_temp_file
289274
290-
# Prepare the required data Linux
275+
# 准备要需要的数据 Linux
291276
- name: Prepare upload for Linux
292277
if: runner.os == 'Linux'
293278
run: |
294279
mkdir oss_temp_file
295280
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
296281
297-
# Upload files to OSS for easy downloading
282+
# 把文件上传到OSS 方便下载
298283
- name: Set up oss utils
299284
uses: yizhoumo/setup-ossutil@v1
300285
with:
@@ -306,7 +291,7 @@ jobs:
306291
run: |
307292
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
308293
309-
# Build completion notification
294+
# 构建完成通知
310295
- name: Send dingtalk message for Windows
311296
if: ${{ runner.os == 'Windows' }}
312297
uses: ghostoy/dingtalk-action@master
@@ -319,7 +304,7 @@ jobs:
319304
"text": "# Windows-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \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) "
320305
}
321306
322-
# Build completion notification
307+
# 构建完成通知
323308
- name: Send dingtalk message for MacOS x86_64
324309
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
325310
uses: ghostoy/dingtalk-action@master
@@ -332,7 +317,7 @@ jobs:
332317
"text": "# MacOS-x86_64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \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) "
333318
}
334319
335-
# Build completion notification
320+
# 构建完成通知
336321
- name: Send dingtalk message for MacOS arm64
337322
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
338323
uses: ghostoy/dingtalk-action@master
@@ -345,7 +330,7 @@ jobs:
345330
"text": "# MacOS-arm64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \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) "
346331
}
347332
348-
# Build completion notification
333+
# 构建完成通知
349334
- name: Send dingtalk message for Linux
350335
if: ${{ runner.os == 'Linux' }}
351336
uses: ghostoy/dingtalk-action@master

0 commit comments

Comments
 (0)