mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-07 10:17:02 +00:00
refactor: interface for versioning strategy
This commit is contained in:
parent
7797a86a48
commit
04ace5cb05
3 changed files with 106 additions and 109 deletions
|
|
@ -13,7 +13,11 @@ type Releases struct {
|
|||
Stable *Tag
|
||||
}
|
||||
|
||||
func (r Releases) NextVersion(versionBump conventionalcommits.VersionBump, nextVersionType NextVersionType) (string, error) {
|
||||
type VersioningStrategy = func(Releases, conventionalcommits.VersionBump, NextVersionType) (string, error)
|
||||
|
||||
var _ VersioningStrategy = SemVerNextVersion
|
||||
|
||||
func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump, nextVersionType NextVersionType) (string, error) {
|
||||
latest, err := parseSemverWithDefault(r.Latest)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse latest version: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue