Skip to content

Commit 4e90a0e

Browse files
committed
🐎 ci: 添加release ci
Signed-off-by: xqyjlj <xqyjlj@126.com>
1 parent 4378af1 commit 4e90a0e

3 files changed

Lines changed: 192 additions & 9 deletions

File tree

.github/workflows/linux.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Licensed under the Apache License v. 2 (the "License")
2+
# You may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# https://www.apache.org/licenses/LICENSE-2.0.html
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
#
13+
# Copyright (C) 2025-2025 xqyjlj<xqyjlj@126.com>
14+
#
15+
# @author xqyjlj
16+
# @file linux.yml
17+
#
18+
# Change Logs:
19+
# Date Author Notes
20+
# ------------ ---------- -----------------------------------------------
21+
# 2025-11-13 xqyjlj initial version
22+
#
23+
24+
name: linux
25+
26+
on:
27+
push:
28+
pull_request:
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
jobs:
35+
release:
36+
name: ⬆️ release
37+
runs-on: ubuntu-latest
38+
if: startsWith(github.ref, 'refs/tags/')
39+
env:
40+
CI_PROJECT_DIR: ${{ github.workspace }}
41+
GITHUB_CSPLINK_DEVELOPER_TOKEN: ${{ github.token }}
42+
steps:
43+
- name: ⬇️ checkout csp
44+
uses: actions/checkout@v4
45+
with:
46+
submodules: recursive
47+
fetch-depth: 1
48+
49+
- name: 📦 Setup pnpm
50+
uses: pnpm/action-setup@v4
51+
52+
- name: 📦 Setup node
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
57+
- name: 📦 setup python
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: 3.10.11
61+
62+
- name: 👷 Install
63+
shell: bash
64+
run: |
65+
pnpm install --frozen-lockfile --no-verify-store-integrity
66+
pnpm server:install
67+
68+
- name: 🔨 Build
69+
shell: bash
70+
run: |
71+
pnpm release
72+
73+
CSP_VERSION=$(npm pkg get version | tr -d '"')
74+
mv -v release/${CSP_VERSION}/csp-Linux-${CSP_VERSION}.AppImage csp-linux-setup-${{ github.ref_name }}.AppImage
75+
pushd release/${CSP_VERSION}/
76+
mv -v linux-unpacked csp-linux-portable-${{ github.ref_name }}
77+
tar czf csp-linux-portable-${{ github.ref_name }}.tar.gz csp-linux-portable-${{ github.ref_name }}
78+
popd
79+
mv -v release/${CSP_VERSION}/csp-linux-portable-${{ github.ref_name }}.tar.gz csp-linux-portable-${{ github.ref_name }}.tar.gz
80+
mv -v build-server/csp-server csp-linux-server-${{ github.ref_name }}
81+
- name: ⬆️ create release
82+
uses: softprops/action-gh-release@v2
83+
with:
84+
name: csp ${{ github.ref_name }}
85+
draft: true
86+
prerelease: true
87+
token: ${{ secrets.RELEASE_TOKEN }}
88+
files: |
89+
csp-linux-setup-${{ github.ref_name }}.AppImage
90+
csp-linux-portable-${{ github.ref_name }}.tar.gz
91+
csp-linux-server-${{ github.ref_name }}

.github/workflows/test.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@ jobs:
5050
with:
5151
node-version: 22
5252

53+
- name: 📦 setup python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: 3.10.11
57+
5358
- name: 👷 Install
5459
shell: bash
5560
run: |
5661
pnpm install --frozen-lockfile --no-verify-store-integrity
62+
pnpm server:install
5763
58-
- name: 👷 Lint
64+
- name: 🧪 Static
5965
shell: bash
6066
run: |
61-
npx electron-builder --version
62-
pnpm run test:lint
63-
pnpm run test:typecheck
64-
65-
# - name: 👷 unit-test
66-
# shell: bash
67-
# run: |
68-
# python3 unit-test.py
67+
pnpm node:static
68+
pnpm server:static
69+
pnpm server:test

.github/workflows/windows.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Licensed under the Apache License v. 2 (the "License")
2+
# You may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# https://www.apache.org/licenses/LICENSE-2.0.html
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
#
13+
# Copyright (C) 2025-2025 xqyjlj<xqyjlj@126.com>
14+
#
15+
# @author xqyjlj
16+
# @file windows.yml
17+
#
18+
# Change Logs:
19+
# Date Author Notes
20+
# ------------ ---------- -----------------------------------------------
21+
# 2025-10-21 xqyjlj initial version
22+
#
23+
24+
name: windows
25+
26+
on:
27+
push:
28+
pull_request:
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
jobs:
35+
release:
36+
name: ⬆️ release
37+
runs-on: windows-latest
38+
if: startsWith(github.ref, 'refs/tags/')
39+
env:
40+
CI_PROJECT_DIR: ${{ github.workspace }}
41+
GITHUB_CSPLINK_DEVELOPER_TOKEN: ${{ github.token }}
42+
steps:
43+
- name: ⬇️ checkout csp
44+
uses: actions/checkout@v4
45+
with:
46+
submodules: recursive
47+
fetch-depth: 1
48+
49+
- name: 📦 Setup pnpm
50+
uses: pnpm/action-setup@v4
51+
52+
- name: 📦 Setup node
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
57+
- name: 📦 setup python
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: 3.10.11
61+
62+
- name: 👷 Install
63+
shell: bash
64+
run: |
65+
pnpm install --frozen-lockfile --no-verify-store-integrity
66+
pnpm server:install
67+
68+
- name: 🔨 Build
69+
shell: bash
70+
run: |
71+
pnpm release
72+
73+
CSP_VERSION=$(npm pkg get version | tr -d '"')
74+
mv -v release/${CSP_VERSION}/csp-Windows-${CSP_VERSION}-Setup.exe csp-windows-setup-${{ github.ref_name }}.exe
75+
pushd release/${CSP_VERSION}/
76+
mv -v win-unpacked csp-windows-portable-${{ github.ref_name }}
77+
7z a csp-windows-portable-${{ github.ref_name }}.zip csp-windows-portable-${{ github.ref_name }}
78+
popd
79+
mv -v release/${CSP_VERSION}/csp-windows-portable-${{ github.ref_name }}.zip csp-windows-portable-${{ github.ref_name }}.zip
80+
mv -v build-server/csp-server.exe csp-windows-server-${{ github.ref_name }}.exe
81+
- name: ⬆️ create release
82+
uses: softprops/action-gh-release@v2
83+
with:
84+
name: csp ${{ github.ref_name }}
85+
draft: true
86+
prerelease: true
87+
token: ${{ secrets.RELEASE_TOKEN }}
88+
files: |
89+
csp-windows-setup-${{ github.ref_name }}.exe
90+
csp-windows-portable-${{ github.ref_name }}.zip
91+
csp-windows-server-${{ github.ref_name }}.exe

0 commit comments

Comments
 (0)