GoReleaser "is not a valid semver tag" in CI
GoReleaser requires the release tag to be valid semver, normally vX.Y.Z. A tag like release-1 or 1.0 fails validation before any build starts.
What this error means
GoReleaser stops with "'<tag>' is not a valid semver tag" and does not build. The tag exists but is not in vMAJOR.MINOR.PATCH form.
⨯ release failed after 0s
error=tag "release-2024-06" is not a valid semver tagCommon causes
The tag is not semantic versioning
Tags such as 1.0, v1, or release-2024-06 lack the full MAJOR.MINOR.PATCH triple GoReleaser validates against.
A prerelease suffix is malformed
A suffix that is not a valid semver prerelease (for example v1.2.3_beta) also fails the check.
How to fix it
Retag with a valid semver tag
- Delete the malformed tag locally and on the remote.
- Create a
vMAJOR.MINOR.PATCHtag such asv1.2.3. - Push the new tag to trigger the release.
git tag -d release-2024-06
git push origin :refs/tags/release-2024-06
git tag v1.2.3
git push origin v1.2.3Use a valid prerelease format
For prereleases, use a dot-separated semver suffix like -rc.1 or -beta.2.
git tag v1.2.3-rc.1
git push origin v1.2.3-rc.1How to prevent it
- Standardize tags on
vX.Y.Zacross the project. - Validate tag format in a pre-release check or a tag protection rule.
- Use
-rc.N/-beta.Nfor prereleases so semver stays valid.