You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-15 01:34:21 +02:00
trying with test fixtures
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
@ -37,6 +38,7 @@ func (p Pipe) Run(ctx *context.Context) (err error) {
|
||||
}
|
||||
|
||||
func (Pipe) doRun(ctx *context.Context, pwd string) (err error) {
|
||||
log.Println("git:", pwd)
|
||||
tag, err := cleanGit(pwd, "describe", "--tags", "--abbrev=0", "--always")
|
||||
if err != nil {
|
||||
return
|
||||
@ -56,16 +58,16 @@ func (Pipe) doRun(ctx *context.Context, pwd string) (err error) {
|
||||
PreviousTag: prev,
|
||||
Diff: log,
|
||||
}
|
||||
// removes usual `v` prefix
|
||||
ctx.Version = strings.TrimPrefix(tag, "v")
|
||||
if versionErr := isVersionValid(ctx.Version); versionErr != nil {
|
||||
return versionErr
|
||||
}
|
||||
commit, err := cleanGit(pwd, "show", "--format='%H'", "HEAD")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ctx.Git.Commit = commit
|
||||
// removes usual `v` prefix
|
||||
ctx.Version = strings.TrimPrefix(tag, "v")
|
||||
if versionErr := isVersionValid(ctx.Version); versionErr != nil {
|
||||
return versionErr
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user