Skip to content

Commit 1b458af

Browse files
committed
这个工作流将在您每次推送 v* 格式的标签(例如 v1.0.0)时自动触发。它会执行以下操作:
1. 在 Windows 环境中构建您的项目。 2. 使用 PyInstaller 将 FastNavGenerator.py 打包成一个独立的 .exe 文件。 3. 创建一个新的 GitHub Release。 4. 将生成的 .exe 文件上传到该 Release 中作为附件。
1 parent 16bace6 commit 1b458af

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Create Release and Upload EXE
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: windows-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install pyinstaller
26+
27+
- name: Build with PyInstaller
28+
run: pyinstaller --onefile --noconsole FastNavGenerator.py
29+
30+
- name: Create Release and Upload Asset
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
files: dist/FastNavGenerator.exe
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)