Caution
NEVER PUBLISH A GITHUB RELEASE FOR A SHORTENED VERSION TAG SUCH AS v1, v2, v1.4, OR v2.3.
These are movable aliases. Publishing an immutable release for one would permanently prevent that tag from being moved or reused, even if the release is deleted.
GitHub releases must use a complete version tag matching vMAJOR.MINOR.PATCH, for example:
v1.4.3v2.0.0v12.6.1
-
Confirm the intended commit is on
mainand all checks pass. -
Draft a GitHub release using a new
vMAJOR.MINOR.PATCHtag. -
Verify the tag, target commit, and release notes.
-
Publish the release. The complete version tag will become immutable.
-
Move the corresponding major-version tag to the released commit.
VERSION=v1.4.3 MAJOR="${VERSION%%.*}" # v1.4.3 -> v1 git fetch --tags git tag --force "$MAJOR" "${VERSION}^{}" git push origin "refs/tags/$MAJOR" --force
-
Verify that both tags resolve to the same commit.
git fetch --tags --force git rev-parse "$MAJOR" git rev-parse "${VERSION}^{}"
Do not create releases retroactively for existing tags. Start with the next version.