From b250a7de5e3e293992625edad1a405ff7f50305b Mon Sep 17 00:00:00 2001 From: MCLauncher Date: Wed, 5 Aug 2026 22:54:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0GitHub=20Actions?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=93=E5=8C=85EXE=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .github/workflows/build-exe.yml: 打tag时自动在Windows环境打包exe并发布Release - requirements.txt改为纯英文注释, 兼容Wine打包环境 - .gitignore排除PyInstaller的dist/build目录 --- .github/workflows/build-exe.yml | 38 +++++++++++++++++++++++++++++++++ .gitignore | 3 +++ requirements.txt | 4 ++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-exe.yml diff --git a/.github/workflows/build-exe.yml b/.github/workflows/build-exe.yml new file mode 100644 index 0000000..912ea88 --- /dev/null +++ b/.github/workflows/build-exe.yml @@ -0,0 +1,38 @@ +name: Build Windows EXE + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + steps: + - name: 检出代码 + uses: actions/checkout@v4 + + - name: 安装 Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: 安装 PyInstaller + run: pip install pyinstaller + + - name: 打包 EXE + run: pyinstaller --onefile --name MeowLauncher --clean launcher.py + + - name: 上传构建产物 (Artifact) + uses: actions/upload-artifact@v4 + with: + name: MeowLauncher-windows-exe + path: dist/MeowLauncher.exe + + - name: 发布到 Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: dist/MeowLauncher.exe + generate_release_notes: true diff --git a/.gitignore b/.gitignore index 39c3e6a..13b75ee 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ __pycache__/ *.pyo *.tmp .mc-lock +dist/ +build/ +*.spec diff --git a/requirements.txt b/requirements.txt index a771e04..1fed9be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -# 本项目零第三方依赖, 仅使用 Python 标准库。 -# 无需 pip install 任何包。 +# This project uses only the Python standard library. +# No third-party packages required. Nothing to install.