Publishing is performed by GitHub Actions after a version bump reaches main.
Git tags and GitHub Releases are created locally after npm publish succeeds.
- Registry: npm (
https://registry.npmjs.org) - Package:
@htnabe/prettier-plugin-go-template - Stable dist-tag:
latest - General prerelease dist-tag:
next - Beta prerelease dist-tag:
beta - Release candidate dist-tag:
rc
The workflow selects the dist-tag from the first prerelease identifier:
| Version | Dist-tag |
|---|---|
1.0.0 |
latest |
1.1.0-alpha.1 |
next |
1.1.0-beta.1 |
beta |
1.1.0-rc.1 |
rc |
Install a specific channel with an explicit tag, for example
npm install @htnabe/prettier-plugin-go-template@beta.
- Start from a release branch (for example
release/v0.0.3). - Update version files without creating a tag:
npm version 0.0.3 --no-git-tag-version-
Commit release changes on the release branch.
-
Create and merge PRs in this order:
release/v0.0.3->devdev->main
-
Do not push directly to
devormain. Release changes must reach both branches through PR merges. -
After the PRs are merged, the
Publish Releaseworkflow runs automatically. It only publishes when thepackage.jsonversion differs from the previousmaincommit, matchespackage-lock.json, and is not already published on npm. Ordinarymainchanges therefore do not create releases.The workflow uses npm trusted publishing via OIDC. Configure the package's trusted publisher for this repository and
.github/workflows/publish.yamlon npm before the first automated release. -
Run the release checks locally before merging the release PR:
npm ci
npm run lint
npm test
npm run build
npm pack --dry-run- After the workflow publishes the package successfully, create and push the
release tag locally from the same
maincommit, then create the GitHub Release:
git checkout main
git pull --ff-only origin main
VERSION=$(node -p "require('./package.json').version")
git tag "v${VERSION}"
git push origin "v${VERSION}"
gh release create "v${VERSION}" --verify-tag --generate-notes --title "v${VERSION}"Tags must never be created before validation and npm publication.
- Do not push directly to
devormainexcept in an explicit emergency approved by maintainers. - Do not delete or move release tags in normal operation. If a release fails after tagging, prefer a follow-up patch release over rewriting tag history.
- Prefer
gh release create --generate-notesso release notes are derived from GitHub history instead of hand-maintained text. - Do not create or push the tag before npm publication has succeeded. This keeps failed package publication from requiring tag or release deletion.
- Do not reuse a version that has already been published to npm. Fix the release commit and use a new version when npm publication has succeeded but the package contents are wrong.