Documentation
¶
Overview ¶
Package version normalizes version strings to PEP 440.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize converts a version string in either semver or PEP 440 format to a PEP 440-compatible string. A leading "v" prefix is stripped first.
Accepted forms:
- Semver pre-release: v1.2.3-alpha.1 → 1.2.3a1
- Semver pre-release: v1.2.3-beta → 1.2.3b0
- PEP 440 direct: v1.2.3 → 1.2.3
- PEP 440 pre-release: 1.2.3a1, 1.2.3.dev0, etc.
func Resolve ¶
Resolve returns a normalized PEP 440 version from an explicit string or, when explicit is empty, from CI environment variables or the current git tag via `git describe --tags --exact-match`.
Environment variables checked (in order):
- GORELEASER_CURRENT_TAG
- GITHUB_REF_NAME
These are checked before running git because shallow clones (common in GitHub Actions) may cause git describe to fail.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.