chore(release): enforce version bump checks

Fail fast when a release tag already exists, and add a local release-check script so version mistakes are caught before commit and publish.

Made-with: Cursor
This commit is contained in:
voson
2026-03-19 11:17:23 +08:00
parent c371da95c3
commit 3973295d6a
3 changed files with 46 additions and 3 deletions

View File

@@ -5,9 +5,6 @@ on:
branches: [main]
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.gitea/workflows/secrets.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -56,6 +53,13 @@ jobs:
echo "将创建新版本 ${tag}"
fi
- name: 严格拦截重复版本
if: steps.ver.outputs.tag_exists == 'true'
run: |
echo "错误: 版本 ${{ steps.ver.outputs.tag }} 已存在,禁止重复发版。"
echo "请先 bump Cargo.toml 中的 version并执行 cargo build 同步 Cargo.lock。"
exit 1
- name: 创建 Tag
if: steps.ver.outputs.tag_exists == 'false'
run: |