mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
refactor: interface for versioning strategy (#109)
This commit is contained in:
parent
11f8403241
commit
ef1d92cff0
5 changed files with 15 additions and 12 deletions
|
|
@ -10,9 +10,11 @@ import (
|
|||
"github.com/apricote/releaser-pleaser/internal/git"
|
||||
)
|
||||
|
||||
var _ Strategy = SemVerNextVersion
|
||||
var SemVer Strategy = semVer{}
|
||||
|
||||
func SemVerNextVersion(r git.Releases, versionBump VersionBump, nextVersionType NextVersionType) (string, error) {
|
||||
type semVer struct{}
|
||||
|
||||
func (s semVer) NextVersion(r git.Releases, versionBump 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