1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-13 11:50:34 +02:00

fix: snapshot should run before before hooks (#4250)

Otherwise .Version will be wrong.

closes #4247
This commit is contained in:
Carlos Alexandro Becker 2023-08-15 10:24:53 -03:00 committed by GitHub
parent ced7a0ab82
commit cb093219c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/context"
) )
// Pipe for checksums. // Pipe for setting up the snapshot feature..
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { return "snapshotting" } func (Pipe) String() string { return "snapshotting" }
@ -26,7 +26,7 @@ func (Pipe) Default(ctx *context.Context) error {
func (Pipe) Run(ctx *context.Context) error { func (Pipe) Run(ctx *context.Context) error {
name, err := tmpl.New(ctx).Apply(ctx.Config.Snapshot.NameTemplate) name, err := tmpl.New(ctx).Apply(ctx.Config.Snapshot.NameTemplate)
if err != nil { if err != nil {
return fmt.Errorf("failed to generate snapshot name: %w", err) return fmt.Errorf("failed to parse snapshot name: %w", err)
} }
if name == "" { if name == "" {
return fmt.Errorf("empty snapshot name") return fmt.Errorf("empty snapshot name")

View File

@ -59,10 +59,10 @@ var BuildPipeline = []Piper{
semver.Pipe{}, semver.Pipe{},
// load default configs // load default configs
defaults.Pipe{}, defaults.Pipe{},
// run global hooks before build
before.Pipe{},
// snapshot version handling // snapshot version handling
snapshot.Pipe{}, snapshot.Pipe{},
// run global hooks before build
before.Pipe{},
// ensure ./dist is clean // ensure ./dist is clean
dist.Pipe{}, dist.Pipe{},
// setup gomod-related stuff // setup gomod-related stuff