release-notes

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Release Notes Generator

发布说明生成器

Generate comprehensive release notes by analyzing git history and GitHub activity.
通过分析Git历史记录和GitHub活动生成全面的发布说明。

Workflow

工作流程

1. Determine Version Range

1. 确定版本范围

bash
undefined
bash
undefined

List recent tags

列出最近的标签

git tag --sort=-creatordate | head -10
git tag --sort=-creatordate | head -10

Find commits since last tag

查找自上次标签以来的提交记录

git log $(git describe --tags --abbrev=0)..HEAD --oneline

Ask user for:
- **New version**: Version number for this release (e.g., v1.2.0)
- **Base reference**: Previous tag or commit to compare from (default: latest tag)
git log $(git describe --tags --abbrev=0)..HEAD --oneline

向用户询问:
- **新版本号**:本次发布的版本号(例如:v1.2.0)
- **基准参考**:用于对比的上一个标签或提交记录(默认:最新标签)

2. Gather Changes

2. 收集变更内容

Run in parallel:
bash
undefined
并行执行以下命令:
bash
undefined

Get commits since last release

获取自上次发布以来的提交记录

git log <base>..HEAD --pretty=format:"%h %s" --no-merges
git log <base>..HEAD --pretty=format:"%h %s" --no-merges

Get merge commits (PRs)

获取合并提交记录(对应PR)

git log <base>..HEAD --merges --pretty=format:"%h %s"

```bash
git log <base>..HEAD --merges --pretty=format:"%h %s"

```bash

Get merged PRs (if GitHub repo)

获取已合并的PR(若为GitHub仓库)

gh pr list --state merged --base main --json number,title,labels,author --limit 100
gh pr list --state merged --base main --json number,title,labels,author --limit 100

Get closed issues linked to PRs

获取与PR关联的已关闭议题

gh issue list --state closed --json number,title,labels --limit 100
undefined
gh issue list --state closed --json number,title,labels --limit 100
undefined

3. Categorize Changes

3. 分类变更内容

Group changes by type based on commit prefixes and PR labels:
CategoryCommit PrefixesPR Labels
Features
feat:
,
feature:
enhancement
,
feature
Bug Fixes
fix:
,
bugfix:
bug
,
fix
Performance
perf:
performance
Documentation
docs:
documentation
Breaking Changes
BREAKING:
,
!:
breaking-change
Dependencies
deps:
,
chore(deps):
dependencies
Other
chore:
,
refactor:
,
style:
,
test:
-
根据提交前缀和PR标签按类型分组变更:
分类提交前缀PR标签
新功能
feat:
,
feature:
enhancement
,
feature
Bug修复
fix:
,
bugfix:
bug
,
fix
性能优化
perf:
performance
文档更新
docs:
documentation
破坏性变更
BREAKING:
,
!:
breaking-change
依赖更新
deps:
,
chore(deps):
dependencies
其他变更
chore:
,
refactor:
,
style:
,
test:
-

4. Generate Release Notes

4. 生成发布说明

Use this format for GitHub Releases:
markdown
undefined
使用以下GitHub Releases格式:
markdown
undefined

What's Changed

变更内容

Breaking Changes

破坏性变更

  • Description of breaking change (#PR)
  • 破坏性变更描述 (#PR编号)

Features

新功能

  • Add new feature X (#123) @author
  • Implement Y functionality (#124) @author
  • 新增功能X (#123) @作者用户名
  • 实现Y功能 (#124) @作者用户名

Bug Fixes

Bug修复

  • Fix issue with Z (#125) @author
  • 修复Z相关问题 (#125) @作者用户名

Performance

性能优化

  • Improve loading speed by 50% (#126) @author
  • 将加载速度提升50% (#126) @作者用户名

Documentation

文档更新

  • Update README with new examples (#127) @author
  • 更新README以添加新示例 (#127) @作者用户名

Other Changes

其他变更

  • Refactor internal APIs (#128) @author
  • 重构内部API (#128) @作者用户名

New Contributors

新贡献者

  • @username made their first contribution in #123
undefined
  • @username 在#123中完成了首次贡献
undefined

5. Output

5. 输出结果

Save to
RELEASE_NOTES.md
in project root.
Optionally create GitHub release:
bash
gh release create <version> --title "<version>" --notes-file RELEASE_NOTES.md
保存到项目根目录的
RELEASE_NOTES.md
文件中。
可选操作:创建GitHub发布:
bash
gh release create <version> --title "<version>" --notes-file RELEASE_NOTES.md

Tips

提示

  • Omit empty sections
  • Link PR numbers:
    (#123)
    auto-links on GitHub
  • Credit authors:
    @username
  • Highlight breaking changes at the top
  • Include upgrade instructions for breaking changes
  • 省略空的章节
  • PR编号链接:
    (#123)
    在GitHub上会自动链接
  • 标注作者:
    @用户名
  • 将破坏性变更放在最上方
  • 为破坏性变更添加升级说明