1- # 贡献者注意:
2- # 下面的 hook-win10toast.py 迁移不要删
3- name : Build and Push Python Binaries
1+ name : Build and Release Python Binaries
42
53on :
64 push :
108jobs :
119 build-linux :
1210 runs-on : ubuntu-latest
11+ container :
12+ image : python:3.6-buster # 适配 NOI Linux 2.0 的 Python 3.6
1313 steps :
1414 - name : Checkout code
1515 uses : actions/checkout@v4
1616
17- - name : Set up Python
18- uses : actions/setup-python@v5
19- with :
20- python-version : ' 3.10' # Linux保持原版本
21- cache : ' pip'
17+ - name : Install PyInstaller for Linux
18+ run : pip install pyinstaller
2219
2320 - name : Compile Python scripts for Linux
2421 run : |
25- pip install -r requirements_linux.txt
2622 mkdir -p bin/linux
27- pyinstaller --onefile --distpath bin/linux chat.py
28- pyinstaller --onefile --distpath bin/linux admin.py
29- pyinstaller --onefile --noconsole --distpath bin/linux client.py
30- pyinstaller --onefile --distpath bin/linux clientcli.py # 新增clientcli.py编译
31- rm chat.spec client.spec clientcli.spec # 删除新增的spec文件
23+ pyinstaller --onefile --distpath bin/linux LTS.py
24+ rm LTS.spec
3225 rm -rf build/
3326
3427 - name : Upload Linux binaries
@@ -46,21 +39,18 @@ jobs:
4639 - name : Set up Python
4740 uses : actions/setup-python@v5
4841 with :
49- python-version : ' 3.6' # 适配Windows 7的Python 3.6
50- cache : ' pip'
42+ python-version : ' 3.6' # 适配 Windows 7 的 Python 3.6
43+
44+ - name : Install PyInstaller for Windows
45+ run : pip install pyinstaller
5146
5247 - name : Compile Python scripts for Windows
5348 run : |
54- pip install -r requirements.txt
55- # 动态获取Python安装路径(适配3.6版本)
49+ # 动态获取 Python 安装路径(适配 3.6 版本)
5650 $site_packages = python -c "import site; print(site.getsitepackages()[0])"
57- Copy-Item -Path hook-win10toast.py "$site_packages\lib\site-packages\PyInstaller\hooks\"
5851 mkdir -Force bin/windows
59- pyinstaller --onefile --distpath bin/windows admin.py
60- pyinstaller --onefile --distpath bin/windows chat.py
61- pyinstaller --onefile --noconsole --distpath bin/windows client.py
62- pyinstaller --onefile --distpath bin/windows clientcli.py # 新增clientcli.py编译
63- Remove-Item -Path "chat.spec", "client.spec", "clientcli.spec" -Force # 删除新增的spec文件
52+ pyinstaller --onefile --distpath bin/windows LTS.py
53+ Remove-Item -Path "LTS.spec" -Force
6454 Remove-Item -Path ".\build" -Recurse -Force
6555
6656 - name : Upload Windows binaries
@@ -69,38 +59,40 @@ jobs:
6959 name : windows-binaries
7060 path : bin/windows/
7161
72- push-binaries :
73- needs : [build-windows , build-linux ]
62+ prerelease-upload :
63+ needs : [build-linux , build-windows ]
7464 runs-on : ubuntu-latest
7565 if : success()
7666 steps :
7767 - name : Checkout code
7868 uses : actions/checkout@v4
79- with :
80- token : ${{ secrets.GITHUB_TOKEN }}
81-
8269 - name : Download Windows binaries
8370 uses : actions/download-artifact@v4
8471 with :
8572 name : windows-binaries
8673 path : bin/windows/
87-
8874 - name : Download Linux binaries
8975 uses : actions/download-artifact@v4
9076 with :
9177 name : linux-binaries
9278 path : bin/linux/
93-
94- - name : Configure Git
95- run : |
96- git config user.name "github-actions"
97- git config user.email "github-actions@users.noreply.github.com"
98-
99- - name : Add and commit binaries
100- run : |
101- git add bin/windows/
102- git add bin/linux/
103- git commit -m "[skip ci] [Bot] Add compiled binaries" || echo "No changes to commit"
104-
105- - name : Push changes
106- run : git push
79+ - name : Create Development Build Pre-release
80+ uses : ncipollo/release-action@v1
81+ with :
82+ tag : dev-build
83+ name : Development Build
84+ body : |
85+ 这是一个基于 `main` 分支最新代码的自动版本。
86+ Commit SHA: ${{ github.sha }}
87+
88+ 提示:
89+ - 此版本为开发测试版,可能包含不稳定的功能或未知的错误。
90+ - 不建议用于生产环境或正式用途。
91+ prerelease : true
92+ allowUpdates : true
93+ artifacts : |
94+ bin/windows/*
95+ bin/linux/*
96+ LTS.py
97+ env :
98+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments