-
Notifications
You must be signed in to change notification settings - Fork 2k
143 lines (125 loc) · 5.23 KB
/
test_linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# # Workflow's name
# name: Build Linux Client
# # Workflow's trigger
# # 在release_test 分支收到推送的时候触发
# on: [push, pull_request]
# jobs:
# release:
# strategy:
# fail-fast: false
# matrix:
# include:
# - os: ubuntu-latest
# runs-on: ${{ matrix.os }}
# steps:
# - name: Check out git repository
# uses: actions/checkout@main
# # 安装jre Linux
# - name: Install Jre for Linux
# if: ${{ runner.os == 'Linux' }}
# uses: actions/setup-java@main
# with:
# java-version: "17"
# distribution: "temurin"
# java-package: "jre"
# # java.security 开放tls1 Linux
# - name: Enable tls1
# if: ${{ runner.os == 'Linux' }}
# run: |
# sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" ${{ env.JAVA_HOME }}/conf/security/java.security
# # 复制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
# - name: Install Node.js
# uses: actions/setup-node@main
# with:
# node-version: 16
# cache: "yarn"
# cache-dependency-path: chat2db-client/yarn.lock
# # 安装java
# - name: Install Java and Maven
# uses: actions/setup-java@main
# with:
# java-version: "17"
# distribution: "temurin"
# cache: "maven"
# # 构建静态文件信息
# - name: Yarn install & build & copy
# run: |
# cd chat2db-client
# yarn install
# yarn run build:web:prod --app_version=99.0.${{ github.run_id }} --app_port=10824
# cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
# # 编译服务端java版本
# - name: Build Java
# run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
# # touch versions
# - name: touch versions
# run: |
# cd chat2db-client
# mkdir versions
# mkdir versions/99.0.${{ github.run_id }}
# mkdir versions/99.0.${{ github.run_id }}/static
# touch version
# echo -n 99.0.${{ github.run_id }} > version
# cp -r version ./versions/
# # 复制服务端java 到指定位置
# - name: Copy App
# run: |
# cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/99.0.${{ github.run_id }}/static/
# cp -r chat2db-server/chat2db-server-start/target/lib chat2db-client/versions/99.0.${{ github.run_id }}/static/lib
# - name: Prepare Build Electron
# run: |
# cd chat2db-client
# yarn run build:web:desktop --app_version=99.0.${{ github.run_id }} --app_port=10824
# cp -r dist ./versions/99.0.${{ github.run_id }}/
# rm -r dist
# - name: Test File
# run: |
# cd chat2db-client/static/jre/
# ls -la
# rm -rf legal
# ls -la
# # Linux
# - name: Build/release Electron app for Linux
# if: ${{ runner.os == 'Linux' }}
# uses: samuelmeuli/action-electron-builder@v1
# with:
# package_root: "chat2db-client/"
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# skip_build: true
# args: "-c.appId=com.chat2db.test -c.productName=Chat2DB-Test -c.nsis.shortcutName=Chat2DB-Test -c.extraMetadata.version=99.0.${{ github.run_id }}-Test --linux"
# # 准备要需要的数据 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 方便下载
# - name: Set up oss utils
# uses: yizhoumo/setup-ossutil@v1
# with:
# endpoint: "oss-accelerate.aliyuncs.com"
# access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
# access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
# ossutil-version: "latest"
# - name: Upload to oss
# run: |
# ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/test/99.0.${{ github.run_id }}/
# # 构建完成通知
# - name: Send dingtalk message for Linux
# if: ${{ runner.os == 'Linux' }}
# uses: ghostoy/dingtalk-action@master
# with:
# webhook: ${{ secrets.DINGTALK_WEBHOOK }}
# msgtype: markdown
# content: |
# {
# "title": "Linux-test-打包完成通知",
# "text": "# Linux-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage) "
# }