Skip to content

Commit

Permalink
Merge pull request #1266 from chat2db/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JerryFan626 authored Apr 7, 2024
2 parents 6f972d3 + 2f31be2 commit 941186e
Show file tree
Hide file tree
Showing 689 changed files with 8,973 additions and 4,508 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/pushdocker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 在标签发布的时候 做2个事情
# When tagging a release, do two things
# 1.
name: Push To Docker

Expand All @@ -21,7 +21,7 @@ jobs:
- name: Check out git repository
uses: actions/checkout@main

# 获取版本号 workflow不支持 所以用插件
# Unable to obtain version number. Since the workflow doesn't support it, we'll use a plugin
- name: Create version
id: chat2db_version
uses: bhowell2/[email protected]
Expand All @@ -30,20 +30,20 @@ jobs:
index_of_str: "refs/tags/v"


# 输出基础信息
# Outputting basic information
- name: Print basic information
run: |
echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
# 安装node
# Install Node.js
- name: Install Node.js
uses: actions/setup-node@main
with:
node-version: 16
cache: "yarn"
cache-dependency-path: chat2db-client/yarn.lock

# 构建静态文件信息
# Build static file information
- name: Yarn install & build & copy
run: |
cd chat2db-client
Expand All @@ -52,15 +52,15 @@ jobs:
cp -r dist ../chat2db-server/chat2db-server-web-start/src/main/resources/static/front
cp -r dist/index.html ../chat2db-server/chat2db-server-web-start/src/main/resources/thymeleaf/
# 安装java
# Install java and maven
- name: Install Java and Maven
uses: actions/setup-java@main
with:
java-version: "17"
distribution: "adopt"
cache: "maven"

# 编译服务端java版本
# Compile server-side Java version
- name: Build Java
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml

Expand All @@ -72,14 +72,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# 登录docker hub
# Log in docker hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# 打包发送到docker
# Packaging and sending to Docker
- name: Build and push
uses: docker/build-push-action@v4
with:
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
name: Build Client

# Workflow's trigger
# 在创建标签的时候打包
# Pack when creating tags
on:
push:
tags:
- v*

# Workflow's jobs
# 一共需要3台电脑运行
# A total of 3 computers are required to run
# windows
# macos-latest x86_64
# macos-latest arm64
Expand All @@ -31,21 +31,21 @@ jobs:
- name: Check out git repository
uses: actions/checkout@main

# 获取版本号 workflow不支持 所以用插件
# Obtaining the version number is not supported by workflow, so a plug-in is used.
- name: Create version
id: chat2db_version
uses: bhowell2/[email protected]
with:
value: ${{ github.ref }}
index_of_str: "refs/tags/v"

# 输出基础信息
# Output basic information
- name: Print basic information
run: |
echo "current environment: ${{ env.CHAT2DB_ENVIRONMENT }}"
echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
# 安装jre Windows
# Install jre Windows
- name: Install Jre for Windows
if: ${{ runner.os == 'Windows' }}
uses: actions/setup-java@main
Expand All @@ -54,7 +54,7 @@ jobs:
distribution: "temurin"
java-package: "jre"

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

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

# 安装jre Linux
# Install jre Linux
- name: Install Jre for Linux
if: ${{ runner.os == 'Linux' }}
uses: actions/setup-java@main
Expand All @@ -82,58 +82,58 @@ jobs:
distribution: "temurin"
java-package: "jre"

# java.security 开放tls1 Windows
# java.security open tls1 Windows
- name: Enable tls1
if: ${{ runner.os == 'Windows' }}
run: |
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
# java.security 开放tls1 macOS
# java.security open tls1 macOS
- name: Enable tls1
if: ${{ runner.os == 'macOS' }}
run: |
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
# 复制jre Windows
# Copy jre Windows
- name: Copy Jre for Windows
if: ${{ runner.os == 'Windows' }}
run: |
mkdir chat2db-client/static
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
# 复制jre macOS
# Copy jre macOS
- name: Copy Jre for macOS
if: ${{ runner.os == 'macOS' }}
run: |
mkdir chat2db-client/static
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
# 复制jre Linux
# Copy jre Linux
- name: Copy Jre for Linux
if: ${{ runner.os == 'Linux' }}
run: |
mkdir chat2db-client/static
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
# 安装node
# Install node
- name: Install Node.js
uses: actions/setup-node@main
with:
node-version: 16
cache: "yarn"
cache-dependency-path: chat2db-client/yarn.lock

# 安装java
# Install java
- name: Install Java and Maven
uses: actions/setup-java@main
with:
java-version: "17"
distribution: "temurin"
cache: "maven"

# 构建静态文件信息
# Build static file information
- name: Yarn install & build & copy
run: |
cd chat2db-client
Expand All @@ -145,7 +145,7 @@ jobs:
yarn
yarn run build
# 编译服务端java版本
# Compile server-side java version
- name: Build Java
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml

Expand All @@ -160,7 +160,7 @@ jobs:
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
cp -r version ./versions/
# 复制服务端java 到指定位置
# Copy server-side java to the specified location
- name: Copy App
run: |
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/${{ steps.chat2db_version.outputs.substring }}/static/
Expand Down Expand Up @@ -245,14 +245,14 @@ jobs:
args: "-c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
release: true

# 准备要需要的数据 Windows
# Prepare the required data Windows
- name: Prepare upload for Windows
if: runner.os == 'Windows'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
# 准备要需要的数据 MacOS x86_64
# Prepare the required data MacOS x86_64
- name: Prepare upload for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
run: |
Expand All @@ -265,21 +265,21 @@ jobs:
cd static/ && zip -r chat2db-server-start.zip ./
cp -r chat2db-server-start.zip ../../../../oss_temp_file
# 准备要需要的数据 MacOS arm64
# Prepare the required data MacOS arm64
- name: Prepare upload for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.dmg ./oss_temp_file
# 准备要需要的数据 Linux
# Prepare the required data Linux
- name: Prepare upload for Linux
if: runner.os == 'Linux'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
# 把文件上传到OSS 方便下载
# Upload files to OSS for easy downloading
- name: Set up oss utils
uses: yizhoumo/setup-ossutil@v1
with:
Expand All @@ -291,7 +291,7 @@ jobs:
run: |
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
# 构建完成通知
# Build completion notification
- name: Send dingtalk message for Windows
if: ${{ runner.os == 'Windows' }}
uses: ghostoy/dingtalk-action@master
Expand All @@ -304,7 +304,7 @@ jobs:
"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) "
}
# 构建完成通知
# Build completion notification
- name: Send dingtalk message for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
uses: ghostoy/dingtalk-action@master
Expand All @@ -317,7 +317,7 @@ jobs:
"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) "
}
# 构建完成通知
# Build completion notification
- name: Send dingtalk message for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
uses: ghostoy/dingtalk-action@master
Expand All @@ -330,7 +330,7 @@ jobs:
"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) "
}
# 构建完成通知
# Build completion notification
- name: Send dingtalk message for Linux
if: ${{ runner.os == 'Linux' }}
uses: ghostoy/dingtalk-action@master
Expand Down
Loading

0 comments on commit 941186e

Please sign in to comment.