Documentation
¶
Overview ¶
Package version provides semantic versioning utilities for release management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BumpType ¶
type BumpType int
BumpType represents the type of version bump
func DetermineBumpType ¶
func DetermineBumpType(commits []changelog.ConventionalCommit) BumpType
DetermineBumpType analyzes commits and returns the highest bump type needed
type Calculator ¶
type Calculator struct {
// contains filtered or unexported fields
}
Calculator handles version calculation for the release workflow
func NewCalculator ¶
func NewCalculator(prefix string) *Calculator
NewCalculator creates a new version calculator
func (*Calculator) CalculateNext ¶
func (c *Calculator) CalculateNext(currentDevVersion, nextEnvVersion string, commits []changelog.ConventionalCommit) (*Version, error)
CalculateNext determines the next version for the lowest environment Parameters:
- currentDevVersion: current version in dev (may be empty or same as nextEnvVersion after promotion)
- nextEnvVersion: version in the next environment (e.g., test)
- commits: conventional commits between nextEnv's SHA and HEAD
Returns the calculated version with appropriate RC suffix
type Version ¶
type Version struct {
Major int
Minor int
Patch int
PreRelease int // -1 means no pre-release suffix, >= 0 is the RC number
Prefix string // e.g., "v" or custom prefix
}
Version represents a semantic version with optional pre-release suffix
func GetLatestRelease ¶
GetLatestRelease returns the latest published (non-prerelease) version from a list of tags
func (*Version) BaseVersion ¶
BaseVersion returns a copy without pre-release suffix