Version tags without the leading v
I tag releases as 4.3.5, not v4.3.5, and I make release-it require a clean main branch and a GitHub release with generated notes I still edit.
I tag releases as `4.3.5`, not `v4.3.5`. That is a small choice, and it is one I had to make explicit in tooling because almost every example assumes the `v`.
I use release-it for this. The important parts of the config are:
- `git.tagName` is `${version}`, so the tag is just the version.
- `git.requireBranch` is `main`, and the working tree has to be clean.
- It does not make a "Release 4.3.5" commit. The tag points at the commit I already have.
- It does create a GitHub release, and it fills the notes from a script I can edit before I publish them.
- It does not publish to npm, because this app is not an npm package.
The `v` prefix is not wrong. A lot of good projects use it. I dropped it because I got tired of sorting, matching, and documenting two forms of the same version. Once the tag, the GitHub release name, and the version in the app all say `4.3.5`, I stop thinking about it.
What the tool is not allowed to do
release-it will do almost anything you leave switched on: bump a package.json, commit, tag, push, publish. I turn off the parts I want to remain deliberate. In particular I do not want a tool to create a commit I did not review, and I do not want it to tag a dirty tree or a branch that is not `main`.
The SHA that gets tagged still has to be a SHA that passed CI. I wrote about gating that in [Gate Releases on GitHub Check Runs, Not Commit Status](/journal/gate-releases-on-github-check-runs-not-commit-status). The tagger and the gate are different tools. One should not run if the other would say no.
Notes are drafted, then edited
Generated notes are a starting point, especially if the commits follow a conventional prefix. They are not the final text. I read them, I remove noise, and I make sure a breaking change is actually called a breaking change.
If you adopt this, pick one form of the version and make the tag, the release name, and the app agree. Then put the "must be on main, must be clean, must not invent a commit" rules in the config so you do not have to remember them on the day you ship.