Skip to content

更新Nuitka和PyInstaller的构建工作流,添加超时设置,修改依赖项,并增加新的配置文件以支持多个项目 #12

更新Nuitka和PyInstaller的构建工作流,添加超时设置,修改依赖项,并增加新的配置文件以支持多个项目

更新Nuitka和PyInstaller的构建工作流,添加超时设置,修改依赖项,并增加新的配置文件以支持多个项目 #12

name: Nuitka Package and Release
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- 'package/nuitka_config.yml'
jobs:
package-and-release:
runs-on: windows-latest
# 添加必要的权限
permissions:
contents: write # 允许创建发布和上传资源
steps:
- name: Set Timezone to China Standard Time
run: tzutil /s "China Standard Time"
shell: pwsh
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: UPX Setup
run: |
mkdir upx
curl -o upx/upx.exe https://assets.ksable.top/github/upx/upx/v5.0.1/windows-amd64/upx.exe
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nuitka pyyaml ordered-set==4.1.0 wheel==0.38.4 zstandard==0.20.0
# - name: insatll mingw
# run: |
# mkdir C:\Users\%username%\AppData\Local\Nuitka\Nuitka\Cache\downloads\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2
# curl -o C:\Users\%username%\AppData\Local\Nuitka\Nuitka\Cache\downloads\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64msvcrt-12.0.0-r2.zip https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64msvcrt-12.0.0-r2.zip
# tar -xf C:\Users\%username%\AppData\Local\Nuitka\Nuitka\Cache\downloads\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64msvcrt-12.0.0-r2.zip -C C:\Users\%username%\AppData\Local\Nuitka\Nuitka\Cache\downloads\gcc\x86_64\14.2.0posix-19.1.1-12.0.0-msvcrt-r2\
# - name: Fix Python encoding (Windows)
# run: |
# # 设置Python使用UTF-8编码
# [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
# # 设置控制台编码为UTF-8
# chcp.com 65001
- name: Run packaging script
run: |
# 设置Python使用UTF-8编码
[System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
# 设置控制台编码为UTF-8
chcp.com 65001
cd package
python nuitka_build.py nuitka_config.yml
- name: Upload files with wildcards
uses: actions/upload-artifact@v4
with:
name: Artifact
path: |
./dist/*.exe
retention-days: 90
if-no-files-found: warn
overwrite: true