git-release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Release Workflow

Git版本发布工作流

Tag the current version and create a GitHub release.
为当前版本打标签并创建GitHub版本发布。

Steps

步骤

  1. Sync main
git checkout main && git pull
  1. Read current version from
    package.json
    ,
    pyproject.toml
    ,
    Cargo.toml
    , or equivalent — whichever exists in the project
  2. Generate release notes
    • Run
      git log --oneline <last-tag>..HEAD
      to get commits since last release
    • Group by type: Features, Bug Fixes, Refactors, Other
    • Format as markdown bullet list
    • Show the user the release notes before proceeding
  3. Tag and push
git tag vX.Y.Z
git push origin main --tags
  1. Create GitHub release
gh release create vX.Y.Z --title "vX.Y.Z" --notes "<release notes from step 3>"
  1. 同步主分支
git checkout main && git pull
  1. 读取当前版本:从
    package.json
    pyproject.toml
    Cargo.toml
    或项目中存在的等效文件读取
  2. 生成发布说明
    • 运行
      git log --oneline <last-tag>..HEAD
      获取上次发布以来的提交记录
    • 按类型分组:功能特性、Bug修复、重构、其他
    • 格式化为Markdown项目符号列表
    • 在继续操作前向用户展示发布说明
  3. 打标签并推送
git tag vX.Y.Z
git push origin main --tags
  1. 创建GitHub版本发布
gh release create vX.Y.Z --title "vX.Y.Z" --notes "<release notes from step 3>"

Rules

规则

  • Always sync main first — never release from a feature branch
  • Tag format:
    vX.Y.Z
    (with
    v
    prefix)
  • Never skip the tag — GitHub release requires a tag
  • Show the user the release notes before creating the release
  • Wait for user confirmation before tagging
  • 始终先同步主分支——绝不要从功能分支发布
  • 标签格式
    vX.Y.Z
    (带
    v
    前缀)
  • 绝不跳过标签——GitHub版本发布需要标签
  • 创建发布前向用户展示发布说明
  • 打标签前等待用户确认