2525 - all
2626 - windows
2727 - linux
28- packager :
29- description : ' 打包工具 (pyinstaller/nuitka/both)'
30- required : false
31- default : ' pyinstaller'
32- type : choice
33- options :
34- - pyinstaller
35- - nuitka
36- - both
3728 release :
3829 description : ' 是否发布版本'
3930 required : false
6253 github.event_name == 'workflow_dispatch' ||
6354 contains(github.event.head_commit.message, '打包') ||
6455 contains(github.event.head_commit.message, 'pi') ||
65- contains(github.event.head_commit.message, 'nk') ||
66- contains(github.event.head_commit.message, 'both') ||
6756 contains(github.event.head_commit.message, 'all') ||
6857 contains(github.event.head_commit.message, 'win') ||
6958 contains(github.event.head_commit.message, 'linux') ||
8473 pack_mode : dir
8574 packager : pyinstaller
8675 platform : windows
87- # Windows Nuitka 构建
88- - os : windows-2022
89- arch : x64
90- pack_mode : dir
91- packager : nuitka
92- platform : windows
93- # Linux 构建
76+ # Linux PyInstaller 构建
9477 - os : ubuntu-22.04
9578 arch : x64
9679 pack_mode : dir
11396 echo "- 平台: ${{ matrix.platform }}"
11497 echo "- 架构: ${{ matrix.arch }}"
11598 echo "- 打包工具: ${{ matrix.packager }}"
99+ echo "- 打包模式: ${{ matrix.pack_mode }}"
116100 echo "- 事件类型: ${{ github.event_name }}"
117101 echo "- Ref: ${{ github.ref }}"
118102 echo "- Commit: ${{ github.sha }}"
@@ -186,15 +170,12 @@ jobs:
186170 # Windows PyInstaller 构建
187171 - name : 运行 Windows PyInstaller 构建
188172 if : |
189- matrix.platform == 'windows' &&
190- matrix.packager == 'pyinstaller' &&
191- (github.event_name != 'workflow_dispatch' ||
192- (inputs.build_target == 'all' || inputs.build_target == 'windows') &&
193- (inputs.packager == 'pyinstaller' || inputs.packager == 'both')) &&
194- (github.event_name == 'workflow_dispatch' ||
173+ matrix.platform == 'windows' &&
174+ (github.event_name != 'workflow_dispatch' ||
175+ (inputs.build_target == 'all' || inputs.build_target == 'windows')) &&
176+ (github.event_name == 'workflow_dispatch' ||
195177 (contains(github.event.head_commit.message, '打包') ||
196178 contains(github.event.head_commit.message, 'pi') ||
197- contains(github.event.head_commit.message, 'both') ||
198179 contains(github.event.head_commit.message, 'all') ||
199180 contains(github.event.head_commit.message, 'win'))) &&
200181 (github.event_name != 'push' ||
@@ -207,49 +188,43 @@ jobs:
207188 echo "依赖同步完成,开始打包..."
208189 uv run build_pyinstaller.py
209190
210- # Windows Nuitka 构建
211- - name : 运行 Windows Nuitka 构建
191+ # Windows PyInstaller 构建
192+ - name : 运行 Windows PyInstaller 构建
212193 if : |
213- matrix.platform == 'windows' &&
214- matrix.packager == 'nuitka' &&
215- (github.event_name != 'workflow_dispatch' ||
216- (inputs.build_target == 'all' || inputs.build_target == 'windows') &&
217- (inputs.packager == 'nuitka' || inputs.packager == 'both')) &&
218- (github.event_name == 'workflow_dispatch' ||
194+ matrix.platform == 'windows' &&
195+ (github.event_name != 'workflow_dispatch' ||
196+ (inputs.build_target == 'all' || inputs.build_target == 'windows')) &&
197+ (github.event_name == 'workflow_dispatch' ||
219198 (contains(github.event.head_commit.message, '打包') ||
220- contains(github.event.head_commit.message, 'nk') ||
221- contains(github.event.head_commit.message, 'both') ||
199+ contains(github.event.head_commit.message, 'pi') ||
222200 contains(github.event.head_commit.message, 'all') ||
223201 contains(github.event.head_commit.message, 'win'))) &&
224202 (github.event_name != 'push' ||
225203 !startsWith(github.ref, 'refs/tags/v') ||
226204 (startsWith(github.ref_name, 'v') && contains(github.ref_name, '.') && !contains(github.ref_name, '-')))
227205 run : |
228- echo "开始 Windows Nuitka 构建流程..."
206+ echo "开始 Windows PyInstaller 构建流程..."
229207 echo "使用uv进行依赖同步..."
230208 uv sync --frozen
231209 echo "依赖同步完成,开始打包..."
232- uv run build_nuitka .py
210+ uv run build_pyinstaller .py
233211
234- # Linux 构建
235- - name : 运行 Linux 构建
212+ # Linux PyInstaller 构建
213+ - name : 运行 Linux PyInstaller 构建
236214 if : |
237- matrix.platform == 'linux' &&
238- matrix.packager == 'pyinstaller' &&
239- (github.event_name != 'workflow_dispatch' ||
240- (inputs.build_target == 'all' || inputs.build_target == 'linux') &&
241- (inputs.packager == 'pyinstaller' || inputs.packager == 'both')) &&
242- (github.event_name == 'workflow_dispatch' ||
215+ matrix.platform == 'linux' &&
216+ (github.event_name != 'workflow_dispatch' ||
217+ (inputs.build_target == 'all' || inputs.build_target == 'linux')) &&
218+ (github.event_name == 'workflow_dispatch' ||
243219 (contains(github.event.head_commit.message, '打包') ||
244220 contains(github.event.head_commit.message, 'pi') ||
245- contains(github.event.head_commit.message, 'both') ||
246221 contains(github.event.head_commit.message, 'all') ||
247222 contains(github.event.head_commit.message, 'linux'))) &&
248223 (github.event_name != 'push' ||
249224 !startsWith(github.ref, 'refs/tags/v') ||
250225 (startsWith(github.ref_name, 'v') && contains(github.ref_name, '.') && !contains(github.ref_name, '-')))
251226 run : |
252- echo "开始 Linux 构建流程..."
227+ echo "开始 Linux PyInstaller 构建流程..."
253228 echo "使用uv进行依赖同步..."
254229 uv sync --frozen
255230 echo "依赖同步完成,开始打包..."
@@ -264,7 +239,7 @@ jobs:
264239 echo "开始 Windows 打包操作..."
265240
266241 # 检查构建是否成功
267- if (!(Test-Path "dist/SecRandom")) {
242+ if (!(Test-Path "dist/SecRandom" -PathType Container )) {
268243 echo "错误:dist/SecRandom 目录不存在,构建可能失败了"
269244 echo "可用的dist目录内容:"
270245 if (Test-Path "dist") {
@@ -278,7 +253,7 @@ jobs:
278253 # 创建zip_dist/SecRandom目录
279254 mkdir -p zip_dist/SecRandom
280255
281- # 复制dist/SecRandom目录下的所有文件到zip_dist/SecRandom目录下
256+ # 复制dist/SecRandom目录内容
282257 Copy-Item -Recurse -Force dist/SecRandom/* zip_dist/SecRandom/
283258
284259 # 创建app目录
@@ -292,11 +267,7 @@ jobs:
292267
293268 # 使用 zip 压缩文件
294269 mkdir zip -Force
295- if ("${{ matrix.packager }}" -eq "nuitka") {
296- $outputZip = "zip/SecRandom-Windows-Nuitka-${{ github.ref_name }}-${{ matrix.arch }}-dir.zip"
297- } else {
298- $outputZip = "zip/SecRandom-Windows-PyInstaller-${{ github.ref_name }}-${{ matrix.arch }}-dir.zip"
299- }
270+ $outputZip = "zip/SecRandom-Windows-${{ github.ref_name }}-${{ matrix.arch }}-dir.zip"
300271 Compress-Archive -Path zip_dist/SecRandom/* -DestinationPath $outputZip -Force
301272 echo "目录模式打包完成: $outputZip"
302273
@@ -323,7 +294,7 @@ jobs:
323294 # 创建zip_dist/SecRandom目录
324295 mkdir -p zip_dist/SecRandom
325296
326- # 复制dist/SecRandom目录下的所有文件到zip_dist/SecRandom目录下
297+ # 复制dist/SecRandom目录内容
327298 cp -r dist/SecRandom/* zip_dist/SecRandom/
328299
329300 # 创建app目录
@@ -348,7 +319,7 @@ jobs:
348319 (github.event_name != 'workflow_dispatch' || inputs.package == 'true')
349320 uses : actions/upload-artifact@v4.4.2
350321 with :
351- name : ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.pack_mode }}-${{ matrix.packager }}
322+ name : ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.pack_mode }}
352323 path : ./zip
353324 retention-days : ${{ env.ARTIFACT_RETENTION_DAYS }}
354325
@@ -407,8 +378,6 @@ jobs:
407378 # Windows 构建产物
408379 mv artifacts/windows-2022-x64-dir-pyinstaller/* release/ 2>/dev/null || echo "未找到 Windows x64 PyInstaller 构建产物"
409380 mv artifacts/windows-2022-x86-dir-pyinstaller/* release/ 2>/dev/null || echo "未找到 Windows x86 PyInstaller 构建产物"
410- mv artifacts/windows-2022-x64-dir-nuitka/* release/ 2>/dev/null || echo "未找到 Windows x64 Nuitka 构建产物"
411- mv artifacts/windows-2022-x86-dir-nuitka/* release/ 2>/dev/null || echo "未找到 Windows x86 Nuitka 构建产物"
412381 # Linux 构建产物
413382 mv artifacts/ubuntu-22.04-x64-dir-pyinstaller/* release/ 2>/dev/null || echo "未找到 Linux x64 构建产物"
414383 echo "构建产物整理完成"
@@ -456,18 +425,14 @@ jobs:
456425 echo "| Linux | x64 | [下载](https://www.123684.com/s/9529jv-U4Fxh) |" >> ../CHANGELOG.md
457426 echo "" >> ../CHANGELOG.md
458427 echo "**Github 镜像 下载链接**" >> ../CHANGELOG.md
459- echo "| 镜像源 | 平台/打包方式 | 支持架构 | 完整版 |" >> ../CHANGELOG.md
428+ echo "| 镜像源 | 平台 | 支持架构 | 完整版 |" >> ../CHANGELOG.md
460429 echo "| --- | --- | --- | --- |" >> ../CHANGELOG.md
461- echo "| ghfast.top | Windows 目录模式 (PyInstaller) | x64 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-PyInstaller-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
462- echo "| ghfast.top | Windows 目录模式 (PyInstaller) | x86 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-PyInstaller-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
463- echo "| ghfast.top | Windows 目录模式 (Nuitka) | x64 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-Nuitka-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
464- echo "| ghfast.top | Windows 目录模式 (Nuitka) | x86 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-Nuitka-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
465- echo "| ghfast.top | Linux 目录模式 | x64 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Linux-${{ github.ref_name }}-x64-dir.tar.gz) |" >> ../CHANGELOG.md
466- echo "| gh-proxy.com | Windows 目录模式 (PyInstaller) | x64 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-PyInstaller-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
467- echo "| gh-proxy.com | Windows 目录模式 (PyInstaller) | x86 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-PyInstaller-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
468- echo "| gh-proxy.com | Windows 目录模式 (Nuitka) | x64 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-Nuitka-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
469- echo "| gh-proxy.com | Windows 目录模式 (Nuitka) | x86 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-Nuitka-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
470- echo "| gh-proxy.com | Linux 目录模式 | x64 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Linux-${{ github.ref_name }}-x64-dir.tar.gz) |" >> ../CHANGELOG.md
430+ echo "| ghfast.top | Windows | x64 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
431+ echo "| ghfast.top | Windows | x86 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
432+ echo "| ghfast.top | Linux | x64 | [下载 ${{ github.ref_name }}](https://ghfast.top/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Linux-${{ github.ref_name }}-x64-dir.tar.gz) |" >> ../CHANGELOG.md
433+ echo "| gh-proxy.com | Windows | x64 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-${{ github.ref_name }}-x64-dir.zip) |" >> ../CHANGELOG.md
434+ echo "| gh-proxy.com | Windows | x86 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Windows-${{ github.ref_name }}-x86-dir.zip) |" >> ../CHANGELOG.md
435+ echo "| gh-proxy.com | Linux | x64 | [下载 ${{ github.ref_name }}](https://gh-proxy.com/https://github.com/SECTL/SecRandom/releases/download/${{ github.ref_name }}/SecRandom-Linux-${{ github.ref_name }}-x64-dir.tar.gz) |" >> ../CHANGELOG.md
471436 echo "" >> ../CHANGELOG.md
472437 echo "**SHA256 校验值-请核对下载的文件的SHA256值是否正确**" >> ../CHANGELOG.md
473438 echo "| 文件名 | SHA256 值 |" >> ../CHANGELOG.md
0 commit comments