Skip to content

Commit 6ab34ef

Browse files
authored
Merge pull request #35 from chenjintang-shrimp/merging-updates
修复由于某些不恰当的合并操作而发生的混乱
2 parents e58fda9 + 3f3e7b2 commit 6ab34ef

95 files changed

Lines changed: 11020 additions & 5650 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/安全漏洞报告.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ assignees: LZY98276
4848
## ✅ 最后确认
4949
- [ ] 我已提供**详细复现步骤**
5050
- [ ] 我理解可能需要**私下沟通**漏洞细节
51-
- [ ] 我愿意协助漏洞修复测试
51+
- [ ] 我愿意协助漏洞修复测试

.github/ISSUE_TEMPLATE/性能问题报告.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ assignees: LZY98276
4646
## ✅ 最后确认
4747
- [ ] 我已提供**具体性能数据****复现步骤**
4848
- [ ] 我理解性能优化可能需要**多轮测试**
49-
- [ ] 我愿意协助进行性能测试和验证
49+
- [ ] 我愿意协助进行性能测试和验证

.github/ISSUE_TEMPLATE/文档改进.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ assignees: yuanbenxin
3030

3131
## ✅ 最后确认
3232
- [ ] 我已提供**具体位置和改进建议**
33-
- [ ] 我知道清晰的描述能帮助开发者快速修复文档问题
33+
- [ ] 我知道清晰的描述能帮助开发者快速修复文档问题

.github/ISSUE_TEMPLATE/问题咨询.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ assignees: LZY98276
3636

3737
## ✅ 最后确认
3838
- [ ] 我已提供**详细问题描述和截图**
39-
- [ ] 我知道可以通过**Discussions**获得更快的社区支持
39+
- [ ] 我知道可以通过**Discussions**获得更快的社区支持

.github/workflows/build-linux.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Linux构建
2+
3+
on:
4+
push:
5+
branches:
6+
- linux-port
7+
pull_request:
8+
branches:
9+
- linux-port
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: build-linux-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
builder_matrix:
18+
permissions:
19+
contents: read
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- os: ubuntu-22.04
25+
arch: x64
26+
pack_mode: dir
27+
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: 检出仓库
31+
uses: actions/checkout@v4.2.2
32+
33+
- name: 安装 Python
34+
uses: actions/setup-python@v5.3.0
35+
with:
36+
python-version: '3.8.10'
37+
architecture: ${{ matrix.arch }}
38+
39+
- name: 安装 uv
40+
uses: astral-sh/setup-uv@v4
41+
42+
- name: 安装系统依赖
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y \
46+
libpulse-dev \
47+
pulseaudio \
48+
libportaudio2 \
49+
libsndfile1 \
50+
libasound2-dev \
51+
portaudio19-dev \
52+
libxcb-xinerama0 \
53+
libxcb-cursor0 \
54+
libxkbcommon-x11-0 \
55+
libgl1-mesa-glx \
56+
libegl1 \
57+
libdbus-1-3 \
58+
libxcb-icccm4 \
59+
libxcb-image0 \
60+
libxcb-keysyms1 \
61+
libxcb-randr0 \
62+
libxcb-render-util0 \
63+
libxcb-shape0
64+
65+
- name: 初始化 zip 文件夹
66+
run: mkdir -p zip
67+
68+
- name: 运行 Linux 构建
69+
run: |
70+
echo "开始 Linux 构建流程..."
71+
# 创建虚拟环境
72+
echo "创建虚拟环境..."
73+
uv venv
74+
75+
# 激活虚拟环境
76+
echo "激活虚拟环境..."
77+
source .venv/bin/activate
78+
79+
# 安装依赖
80+
echo "安装项目依赖..."
81+
uv pip install -r requirements-linux.txt
82+
83+
# 安装 pyinstaller
84+
echo "安装 PyInstaller..."
85+
uv pip install pyinstaller
86+
87+
# 清理之前的构建文件
88+
echo "清理之前的构建文件..."
89+
rm -rf dist build zip_dist
90+
echo "构建环境准备完成"
91+
92+
# 目录模式打包
93+
echo "开始目录模式打包..."
94+
pyinstaller main.py \
95+
-w \
96+
-D \
97+
-i ./resources/secrandom-icon-paper.ico \
98+
-n SecRandom \
99+
--add-data ./app/resources:app/resources \
100+
--add-data LICENSE:.
101+
echo "目录模式打包完成"
102+
103+
- name: 打包操作
104+
run: |
105+
echo "开始打包操作..."
106+
107+
# 创建zip_dist/SecRandom目录
108+
mkdir -p zip_dist/SecRandom
109+
110+
# 复制dist/SecRandom目录下的所有文件到zip_dist/SecRandom目录下
111+
cp -r dist/SecRandom/* zip_dist/SecRandom/
112+
113+
# 创建app目录
114+
mkdir -p zip_dist/SecRandom/app
115+
116+
# 复制app/resources文件夹到zip_dist/SecRandom目录下
117+
cp -r app/resources zip_dist/SecRandom/app/
118+
119+
# 复制 LICENSE 文件到zip_dist/SecRandom目录下
120+
cp LICENSE zip_dist/SecRandom/
121+
122+
# 使用 tar 压缩文件
123+
mkdir -p zip
124+
cd zip_dist
125+
tar -czf ../zip/SecRandom-Linux-${{ github.ref_name }}-${{ matrix.arch }}-dir.tar.gz SecRandom/
126+
cd ..
127+
echo "目录模式打包完成: zip/SecRandom-Linux-${{ github.ref_name }}-${{ matrix.arch }}-dir.tar.gz"
128+
129+
- name: 上传应用程序
130+
if: ${{ github.event_name != 'pull_request' }}
131+
uses: actions/upload-artifact@v4.4.2
132+
with:
133+
name: linux-${{ matrix.arch }}-${{ matrix.pack_mode }}
134+
path: ./zip

.github/workflows/build.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 构建
22

3-
on:
3+
on:
44
push:
55
pull_request:
66
workflow_dispatch:
@@ -13,7 +13,7 @@ jobs:
1313
builder_matrix:
1414
# 仅在push或pull_request事件包含'进行打包'时执行,workflow_dispatch无条件执行
1515
if: |
16-
github.event_name == 'workflow_dispatch' ||
16+
github.event_name == 'workflow_dispatch' ||
1717
contains(github.event.head_commit.message, '进行打包') ||
1818
(github.event_name == 'pull_request' && contains(github.event.pull_request.title, '进行打包'))
1919
strategy:
@@ -58,21 +58,21 @@ jobs:
5858
echo "创建虚拟环境..."
5959
uv venv
6060
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
61-
61+
6262
# 激活虚拟环境
6363
echo "激活虚拟环境..."
6464
.venv/Scripts/activate
65-
65+
6666
# 安装依赖
6767
echo "安装项目依赖..."
6868
uv pip install -r requirements-windows.txt
6969
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
70-
70+
7171
# 安装 pyinstaller
7272
echo "安装 PyInstaller..."
7373
uv pip install pyinstaller
7474
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
75-
75+
7676
# 清理之前的构建文件
7777
echo "清理之前的构建文件..."
7878
Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue
@@ -91,33 +91,33 @@ jobs:
9191
--add-data ./app/resources:app/resources `
9292
--add-data LICENSE:. `
9393
--version-file=version_info.txt
94-
if ($LASTEXITCODE -ne 0) {
94+
if ($LASTEXITCODE -ne 0) {
9595
echo "目录模式打包失败"
96-
exit $LASTEXITCODE
96+
exit $LASTEXITCODE
9797
}
9898
echo "目录模式打包完成"
9999
}
100100
101101
- name: 打包操作
102-
if: ${{ matrix.os == 'windows-2022'}}
102+
if: ${{ matrix.os == 'windows-2022'}}
103103
run: |
104104
echo "开始打包操作..."
105-
105+
106106
# 创建zip_dist/SecRandom目录
107107
mkdir -p zip_dist/SecRandom
108-
108+
109109
# 复制dist/SecRandom目录下的所有文件到zip_dist/SecRandom目录下
110110
Copy-Item -Recurse -Force dist/SecRandom/* zip_dist/SecRandom/
111-
111+
112112
# 创建app目录
113113
mkdir -p zip_dist/SecRandom/app
114-
114+
115115
# 复制app/resources文件夹到zip_dist/SecRandom目录下
116116
Copy-Item -Recurse -Force app/resources zip_dist/SecRandom/app
117-
117+
118118
# 复制 LICENSE 文件到zip_dist/SecRandom目录下
119119
Copy-Item LICENSE zip_dist/SecRandom/
120-
120+
121121
# 使用 zip 压缩文件
122122
mkdir zip -Force
123123
$outputZip = "zip/SecRandom-Windows-${{ github.ref_name }}-${{ matrix.arch }}-dir.zip"
@@ -163,7 +163,7 @@ jobs:
163163
path: artifacts
164164
run-id: ${{ github.run_id }}
165165

166-
- name: 准备 artifacts
166+
- name: 准备 artifacts
167167
run: |
168168
echo "整理构建产物..."
169169
# Windows 构建产物
@@ -185,7 +185,7 @@ jobs:
185185
done
186186
echo "SHA256校验值计算完成:"
187187
cat SHA256SUMS.txt
188-
188+
189189
- name: 验证 SHA256SUMS.txt 文件
190190
run: |
191191
echo "验证SHA256SUMS.txt文件..."
@@ -230,7 +230,7 @@ jobs:
230230
done < SHA256SUMS.txt
231231
rm SHA256SUMS.txt
232232
cd ..
233-
233+
234234
- name: 确定发布类型
235235
id: release-type
236236
run: |
@@ -252,4 +252,4 @@ jobs:
252252
name: SecRandom 新版本 - ${{ github.ref_name }}
253253
fail_on_unmatched_files: true
254254
env:
255-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
255+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeQL.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
analyze:
10+
name: CodeQL Analysis
11+
runs-on: ubuntu-latest
12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Initialize CodeQL
22+
uses: github/codeql-action/init@v3
23+
with:
24+
languages: python
25+
26+
- name: Autobuild (optional for Python)
27+
uses: github/codeql-action/autobuild@v3
28+
29+
- name: Perform CodeQL Analysis
30+
uses: github/codeql-action/analyze@v3

.github/workflows/pre-commit.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Pre-commit
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python 3.8.10
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.8.10"
19+
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v3
22+
with:
23+
enable-cache: true
24+
25+
- name: Install pre-commit with uv
26+
run: uv pip install pre-commit
27+
28+
- name: Run pre-commit on all files
29+
run: pre-commit run --all-files

.github/workflows/pyright.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# name: Pyright
2+
3+
# on:
4+
# push:
5+
# branches: [main, develop]
6+
# pull_request:
7+
# branches: [main]
8+
9+
# jobs:
10+
# pyright:
11+
# runs-on: ubuntu-latest
12+
# steps:
13+
# - uses: actions/checkout@v4
14+
15+
# - name: Set up Python 3.8.10
16+
# uses: actions/setup-python@v5
17+
# with:
18+
# python-version: "3.8.10"
19+
20+
# - name: Setup uv
21+
# uses: astral-sh/setup-uv@v3
22+
# with:
23+
# enable-cache: true
24+
25+
# - name: Install dependencies with uv
26+
# run: |
27+
# uv pip install pyright
28+
# # 如果有项目依赖
29+
# uv pip install -r requirements.txt # 或 uv sync(若用 pyproject.toml + uv project)
30+
31+
# - name: Run Pyright
32+
# run: pyright

0 commit comments

Comments
 (0)