Skip to content

Commit c00a371

Browse files
LevelDownRefineWorkBuddy
andauthored
chore(release): 用 tag 触发的正式 release 取代 nightly (#44)
- 删除 nightly.yml(每天 09:30 的 schedule 触发 + 覆盖 nightly prerelease); 改为 release.yml:推送 v* tag 时自动打包并发布同名正式 release, 手动 workflow_dispatch 仅做构建+exe 集成测试(不发布)。 - pyproject version 0.1.0 -> 0.0.1,版本号以 tag 为准(v0.0.1 起,发新版打新 tag 即递增)。 Co-authored-by: WorkBuddy <noreply@workbuddy.ai>
1 parent dc9b3a9 commit c00a371

3 files changed

Lines changed: 53 additions & 102 deletions

File tree

‎.github/workflows/nightly.yml‎

Lines changed: 0 additions & 101 deletions
This file was deleted.

‎.github/workflows/release.yml‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onedragon-scriptchainer"
3-
version = "0.1.0"
3+
version = "0.0.1"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.11"

0 commit comments

Comments
 (0)