refactor: move git to package

This commit is contained in:
Julian Tölle 2024-08-30 22:47:50 +02:00
parent 44184a77f9
commit 5765b48703
10 changed files with 114 additions and 102 deletions

View file

@ -6,11 +6,13 @@ import (
"github.com/blang/semver/v4"
"github.com/leodido/go-conventionalcommits"
"github.com/apricote/releaser-pleaser/internal/git"
)
type Releases struct {
Latest *Tag
Stable *Tag
Latest *git.Tag
Stable *git.Tag
}
type VersioningStrategy = func(Releases, conventionalcommits.VersionBump, NextVersionType) (string, error)
@ -97,7 +99,7 @@ func setPRVersion(version *semver.Version, prType string, count uint64) {
}
}
func parseSemverWithDefault(tag *Tag) (semver.Version, error) {
func parseSemverWithDefault(tag *git.Tag) (semver.Version, error) {
version := "v0.0.0"
if tag != nil {
version = tag.Name