@@ -29,13 +29,23 @@ jobs:
29
29
pip install -r requirements.txt
30
30
pip install pyinstaller
31
31
32
- # 4. 使用 PyInstaller 打包
32
+ # 4. 使用 PyInstaller 打包两个架构
33
33
- name : Build standalone application
34
34
run : |
35
- # 生成单文件可执行程序
36
- pyinstaller --onefile everything.py
37
- # 将 dist 目录打包成 zip 以便上传
38
- zip -r everything-dist.zip dist
35
+ # 创建x86_64版本
36
+ pyinstaller --target-architecture x86_64 --onefile --windowed --noconsole everything.py
37
+ mkdir -p dist_x86_64
38
+ mv dist/everything dist_x86_64/
39
+ zip -r everything-x86_64.zip dist_x86_64
40
+
41
+ # 清理构建文件
42
+ rm -rf build dist
43
+
44
+ # 创建arm64版本
45
+ pyinstaller --target-architecture arm64 --onefile --windowed --noconsole everything.py
46
+ mkdir -p dist_arm64
47
+ mv dist/everything dist_arm64/
48
+ zip -r everything-arm64.zip dist_arm64
39
49
40
50
# 5. 创建 GitHub Release
41
51
- name : Create GitHub release
@@ -49,14 +59,24 @@ jobs:
49
59
draft : false
50
60
prerelease : false
51
61
52
- # 6. 上传打包好的 zip 文件到 Release
53
- - name : Upload release asset
54
- id : upload_release_asset
62
+ # 6. 上传 x86_64 版本
63
+ - name : Upload x86_64 release asset
55
64
uses : actions/upload-release-asset@v1
56
65
env :
57
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # <-- Important for authentication!
66
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
+ with :
68
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
69
+ asset_path : everything-x86_64.zip
70
+ asset_name : everything-x86_64.zip
71
+ asset_content_type : application/zip
72
+
73
+ # 7. 上传 arm64 版本
74
+ - name : Upload arm64 release asset
75
+ uses : actions/upload-release-asset@v1
76
+ env :
77
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
78
with :
59
79
upload_url : ${{ steps.create_release.outputs.upload_url }}
60
- asset_path : everything-dist .zip
61
- asset_name : everything-dist .zip
80
+ asset_path : everything-arm64 .zip
81
+ asset_name : everything-arm64 .zip
62
82
asset_content_type : application/zip
0 commit comments