File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Release Build
2+
3+ # 推送 v* tag 时自动打包并发布正式 release;手动 workflow_dispatch 仅做构建+exe 集成测试(调试用,不发布)。
4+ # 版本号即 tag 名(如 v0.0.1),发新版时打新 tag 即「每次递增」。
5+ on :
6+ push :
7+ tags :
8+ - " v*"
9+ workflow_dispatch :
10+
11+ permissions :
12+ contents : write # 创建 release 与 tag 需要写权限
13+
14+ jobs :
15+ release :
16+ runs-on : windows-latest
17+ env :
18+ PYTHONUTF8 : 1 # 与 build-exe.yml 同源:冻结 exe 在英文 locale 下经 colorama 输出中文不崩
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v4
23+ with :
24+ submodules : recursive
25+ fetch-depth : 0
26+
27+ - name : Set up uv
28+ uses : astral-sh/setup-uv@v5
29+
30+ # 复用 build-exe.yml 的构建链路:打包 GUI(onedir)+Runner(onefile) 并跑 exe 集成测试。
31+ # exe 测试失败则 build.bat 非 0 退出,本步骤失败 ⇒ 不发布。
32+ - name : Build EXE and run exe integration tests
33+ shell : cmd
34+ run : call deploy\build.bat
35+
36+ - name : Package dist into zip
37+ shell : pwsh
38+ run : Compress-Archive -Path deploy/dist/OneDragon-Helper -DestinationPath OneDragon-Helper.zip
39+
40+ # 仅 tag 触发时发布正式 release(手动 dispatch 跳过,避免用分支名造出错误 release)。
41+ - name : Create release
42+ if : startsWith(github.ref, 'refs/tags/')
43+ shell : bash
44+ env :
45+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46+ run : |
47+ version="${GITHUB_REF_NAME}" # 形如 v0.0.1
48+ gh release create "$version" \
49+ --target "$GITHUB_SHA" \
50+ --title "$version" \
51+ --notes "自动构建发布 $version。对应 commit: $GITHUB_SHA" \
52+ OneDragon-Helper.zip
Original file line number Diff line number Diff line change 11[project ]
22name = " onedragon-scriptchainer"
3- version = " 0.1.0 "
3+ version = " 0.0.1 "
44description = " Add your description here"
55readme = " README.md"
66requires-python = " >=3.11"
You can’t perform that action at this time.
0 commit comments