@@ -109,60 +109,29 @@ jobs:
109109 steps :
110110 - name : Checkout code
111111 uses : actions/checkout@v5
112-
113112 - name : Set up Python
114113 uses : actions/setup-python@v6
115114 with :
116- python-version : ' 3.12' # 推荐使用 3.12 稳定版
117-
115+ python-version : ' 3.14'
118116 - name : Install dependencies
119117 run : |
120118 python -m venv .venv
121119 source .venv/bin/activate
122120 python -m pip install --upgrade pip
123121 pip install pyinstaller
124122 pip install -r requirements.txt
125-
126123 - name : Build app with PyInstaller
127124 run : |
128- # 激活虚拟环境
129- source .venv/bin/activate
130-
131- # 执行打包命令
132- # --clean: 清理缓存
133- # --onefile: 强制生成单文件
134- # --name: 指定输出文件名
135- # --add-data: 打包资源文件 (格式为 源路径:目标路径)
136- # src/tchMaterial-parser.pyw: 你的入口脚本
137-
138- pyinstaller --clean --onefile --name tchMaterial-parser \
139- --add-data "res:res" \
140- --add-data "version.txt:." \
141- src/tchMaterial-parser.pyw
142-
143- - name : Sign the binary
144- run : |
145- # 对生成的单文件进行 Ad-hoc 签名
146- # 这一步是解决“文件已损坏”的核心
147- codesign --force --deep --sign - dist/tchMaterial-parser
148-
125+ .venv/bin/pyinstaller ./tchMaterial-parser.spec
149126 - name : Create zip archive
150127 run : |
151128 cd dist
152- # 改名为带架构后缀的文件名
153- mv tchMaterial-parser tchMaterial-parser-mac-arm64
154-
155- # 赋予可执行权限(双重保险)
156- chmod +x tchMaterial-parser-mac-arm64
157-
158- # 压缩为 zip
159- zip -r tchMaterial-parser-mac-arm64.zip tchMaterial-parser-mac-arm64
160-
129+ mv tchMaterial-parser tchMaterial-parser-mac-arm64.app
130+ zip -r tchMaterial-parser-mac-arm64.zip tchMaterial-parser-mac-arm64.app
161131 - name : Upload Release Asset
162132 uses : softprops/action-gh-release@v2
163133 with :
164134 files : dist/tchMaterial-parser-mac-arm64.zip
165135 tag_name : ${{ inputs.tag || github.ref_name }}
166136 env :
167137 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168-
0 commit comments