com um clique
release
// Release a new version of the coerce-form-data npm package. Bump version, build, publish, and create a GitHub release. Use when the user mentions releasing, publishing, cutting a release, or shipping a new version.
// Release a new version of the coerce-form-data npm package. Bump version, build, publish, and create a GitHub release. Use when the user mentions releasing, publishing, cutting a release, or shipping a new version.
| name | release |
| description | Release a new version of the coerce-form-data npm package. Bump version, build, publish, and create a GitHub release. Use when the user mentions releasing, publishing, cutting a release, or shipping a new version. |
| metadata | {"internal":true} |
Automate the release workflow for the coerce-form-data npm package.
Find the latest git tag:
git tag --list 'v*' --sort=-version:refname | head -1
Read the current version from package.json.
Get the diff since the last release tag:
git log <last-tag>..HEAD --oneline
git diff <last-tag>..HEAD --stat
Determine the next version following semver:
Bump the patch version unless the user specifies otherwise.
Edit package.json to set the new version number.
pnpm install
This updates the lockfile with the new version.
pnpm run lint-fix && pnpm run lint && pnpm run tsc && pnpm run test && pnpm run build
All must pass before proceeding.
Commit package.json and pnpm-lock.yaml with message v<new-version>. Push to main.
Tell the user to run:
npm publish
Do not run npm publish yourself — it requires an OTP. Wait for the user to confirm they've published before continuing.
Once the user confirms the publish, create a GitHub release.
Write release notes by analyzing the diff between the previous tag and HEAD. Follow the pattern from previous releases:
## What's Changed section with PR links and a **Full Changelog** compare link.## What's Changed section with bullet points linking to merged PRs, and a **Full Changelog** compare link.List merged PRs between the two tags:
gh pr list --search "is:merged merged:>=<last-tag-date>" --json number,title,author --limit 100
Format each PR as:
* <title> by @<author> in https://github.com/seasonedcc/coerce-form-data/pull/<number>
End with:
**Full Changelog**: https://github.com/seasonedcc/coerce-form-data/compare/v<previous>...v<new>
Create the release:
gh release create v<new-version> --title "v<new-version>" --notes "<release-notes>"
Use a HEREDOC for the notes to preserve formatting.