release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Release Workflow

发布工作流程

Publish a new version of
@m1heng-clawd/feishu
to npm and create a GitHub release.
@m1heng-clawd/feishu
的新版本发布到npm并创建GitHub Release。

Prerequisites

前置条件

  • Working tree is clean (all changes committed to
    main
    )
  • npm login
    session is active with publish access to
    @m1heng-clawd
    scope
  • gh
    CLI is authenticated
  • 工作树干净(所有更改已提交到
    main
    分支)
  • npm login
    会话处于活跃状态,且拥有
    @m1heng-clawd
    作用域的发布权限
  • gh
    CLI已完成身份验证

Steps

步骤

1. Determine version bump

1. 确定版本更新类型

Check what changed since the last release:
bash
undefined
检查自上次发布以来的变更:
bash
undefined

Find latest release tag

查找最新的发布标签

gh release list --limit 1
gh release list --limit 1

Review commits and diff stat

查看提交记录和差异统计

git log <last-tag>..HEAD --oneline git diff <last-tag>..HEAD --stat

Choose bump type: `patch` (bug fixes), `minor` (new features), or `major` (breaking changes).
git log <last-tag>..HEAD --oneline git diff <last-tag>..HEAD --stat

选择版本更新类型:`patch`(修复bug)、`minor`(新增功能)或`major`(破坏性变更)。

2. Type check

2. 类型检查

bash
npx tsc --noEmit
Do NOT proceed if type check fails.
bash
npx tsc --noEmit
如果类型检查失败,请不要继续。

3. Draft release notes

3. 撰写发布说明

Review the full diff to write release notes:
bash
git diff <last-tag>..HEAD
Create a GitHub release draft first:
bash
gh release create v<new-version> --draft --title "v<new-version>" --target main --notes "<release notes markdown>"
查看完整差异以编写发布说明:
bash
git diff <last-tag>..HEAD
首先创建一个GitHub Release草稿
bash
gh release create v<new-version> --draft --title "v<new-version>" --target main --notes "<release notes markdown>"

4. Bump version in package.json

4. 更新package.json中的版本

Edit
package.json
to update the
"version"
field to
<new-version>
.
编辑
package.json
"version"
字段更新为
<new-version>

5. Commit, tag, and push

5. 提交、打标签并推送

bash
git add package.json
git commit -m "chore: bump version to <new-version>"
git tag v<new-version>
git push && git push --tags
bash
git add package.json
git commit -m "chore: bump version to <new-version>"
git tag v<new-version>
git push && git push --tags

6. Publish to npm

6. 发布到npm

bash
npm publish
If auth fails, ask the user to run
npm login
first, then retry.
bash
npm publish
如果身份验证失败,请让用户先运行
npm login
,然后重试。

7. Publish GitHub release

7. 发布GitHub Release

bash
gh release edit v<new-version> --draft=false
bash
gh release edit v<new-version> --draft=false

Release Notes Format

发布说明格式

Follow the established format (see previous releases for reference):
markdown
undefined
遵循既定格式(可参考过往发布版本):
markdown
undefined

Features

功能特性

  • Feature title — Description. (#PR)
  • 功能标题 — 描述。(#PR)

Bug Fixes

Bug修复

  • Fix title — Description. (#PR)
  • 修复标题 — 描述。(#PR)

Internal

内部变更

  • Internal change description.
undefined
  • 内部变更描述。
undefined

Troubleshooting

故障排除

npm publish 404 / auth error

npm publish 404 / 身份验证错误

bash
npm login          # re-authenticate
npm whoami         # verify logged in
npm publish        # retry
bash
npm login          # 重新验证身份
npm whoami         # 验证登录状态
npm publish        # 重试发布

Tag already exists

标签已存在

If the tag was created but publish failed, delete and recreate after fixing:
bash
git tag -d v<version>
git push origin :refs/tags/v<version>
如果标签已创建但发布失败,请在修复问题后删除并重新创建:
bash
git tag -d v<version>
git push origin :refs/tags/v<version>

fix issue, then re-tag and push

修复问题后,重新打标签并推送

undefined
undefined