File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7777 if [ "${{ matrix.goos }}" == "windows" ]; then
7878 pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py
7979 else
80- pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py
80+ # macOS: 根据目标架构设置环境变量
81+ if [ "${{ matrix.goarch }}" == "arm64" ]; then
82+ # Apple Silicon: 确保使用 arm64 Python
83+ export ARCHFLAGS="-arch arm64"
84+ pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py
85+ else
86+ # Intel: 使用 x86_64 架构(可能需要 Rosetta)
87+ export ARCHFLAGS="-arch x86_64"
88+ # 在 Apple Silicon runner 上,使用 Rosetta 运行
89+ if [ "$(uname -m)" == "arm64" ]; then
90+ arch -x86_64 pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py || pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py
91+ else
92+ pyinstaller --onefile --windowed --name ECHWorkersGUI gui.py
93+ fi
94+ fi
8195 fi
8296 shell : bash
8397
You can’t perform that action at this time.
0 commit comments