Skip to content

Commit 0da857b

Browse files
authored
The TouchFish v4 -- Merge pull request #58 from 035966-L3/main
v4
2 parents 66061cd + fc9969e commit 0da857b

16 files changed

Lines changed: 1832 additions & 2508 deletions

.github/workflows/compile_py.yml

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# 贡献者注意:
2-
# 下面的 hook-win10toast.py 迁移不要删
3-
name: Build and Push Python Binaries
1+
name: Build and Release Python Binaries
42

53
on:
64
push:
@@ -10,25 +8,20 @@ on:
108
jobs:
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 }}

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
__pycache__
2-
log.txt
32
config.json
4-
hint.txt
5-
admin_err.log
3+
log.txt
4+
TouchFishFiles

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TouchFish 贡献者须知 V2
1+
# TouchFish 贡献者须知 v2
22

33
感谢你为项目贡献代码!在提交 PR 前,请仔细阅读以下指引:
44

@@ -10,6 +10,7 @@
1010
- 变量名应具有描述性,推荐使用下划线分隔,如 `exit_flag`
1111
- **代码结构**:单文件超过 800 行时应考虑拆分为独立的模块
1212
- **修改范围**:每次修改请控制在 200 行以内,大幅改动请拆分多个 PR
13+
- **界面要求**:请保持命令行界面,不接受可视化改动
1314

1415
## 二、测试与质量
1516
- **测试覆盖**:每次提交必须保证测试覆盖(文档类修改除外)
@@ -27,7 +28,4 @@
2728
- 请勿频繁催促审核
2829
- **合并流程**:当 PR 被标记为 **Action: Merge** 时,表示即将合并
2930

30-
## 四、关于服务端的说明
31-
- **界面要求**:服务端(`chat.py``admin.py`)请保持命令行界面,不接受可视化改动(部分发行版的 admin 除外)
32-
33-
感谢你的理解与配合,我们期待看到你的精彩贡献!
31+
感谢你的理解与配合,我们期待看到你的精彩贡献!

0 commit comments

Comments
 (0)