ci: 主分支更新后自动按语义化版本发版 - #2
Merged
Merged
Conversation
新增两个 GitHub Actions 工作流: - release.yml:push 到 main 时先跑测试,再按 Conventional Commits 自动计算版本、打 vX.Y.Z tag 并发布 GitHub Release。 - ci.yml:PR 与非 main 分支 push 时运行测试(Python 3.10/3.12)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
项目此前没有任何 CI/CD,版本靠手动打 tag(现有
v0.2.0、v0.4.0)。本 PR 让主分支更新后自动产出新版本。改动
.github/workflows/release.yml— 主分支自动发版main→ 先跑测试(python -m unittest,全 stdlib)作为门禁feat→minor,fix→patch,BREAKING CHANGE→major)vX.Y.Ztag(沿用现有命名)并发布 GitHub Release,notes 用自动 changelog.github/workflows/ci.yml— PR / 非 main 分支测试说明
push: main,无死循环default_bump: patch:主分支每次更新都出新版本;若只想在 feat/fix 时发版,改为default_bump: falseGITHUB_TOKEN(已声明contents: write),需确保仓库 Actions 权限允许写入🤖 Generated with Claude Code