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