1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: snapshot should run before before hooks

Otherwise .Version will be wrong.

closes #4247
This commit is contained in:
Carlos Alexandro Becker 2023-08-15 12:29:37 +00:00
parent ced7a0ab82
commit ceb4e52d12
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/goreleaser/goreleaser/pkg/context"
)
// Pipe for checksums.
// Pipe for setting up the snapshot feature..
type Pipe struct{}
func (Pipe) String() string { return "snapshotting" }
@ -26,7 +26,7 @@ func (Pipe) Default(ctx *context.Context) error {
func (Pipe) Run(ctx *context.Context) error {
name, err := tmpl.New(ctx).Apply(ctx.Config.Snapshot.NameTemplate)
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 == "" {
return fmt.Errorf("empty snapshot name")

View File

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