mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-29 01:44:39 +02:00
fix: checksum extra_files when no builds (#2692)
This commit is contained in:
parent
ff0fdf3520
commit
37f8167fd9
@ -47,9 +47,6 @@ func (Pipe) Run(ctx *context.Context) (err error) {
|
||||
}
|
||||
|
||||
artifactList := ctx.Artifacts.Filter(filter).List()
|
||||
if len(artifactList) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
extraFiles, err := extrafiles.Find(ctx, ctx.Config.Checksum.ExtraFiles)
|
||||
if err != nil {
|
||||
@ -64,6 +61,10 @@ func (Pipe) Run(ctx *context.Context) (err error) {
|
||||
})
|
||||
}
|
||||
|
||||
if len(artifactList) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
g := semerrgroup.New(ctx.Parallelism)
|
||||
sumLines := make([]string, len(artifactList))
|
||||
for i, artifact := range artifactList {
|
||||
|
@ -230,6 +230,7 @@ func TestPipeCheckSumsWithExtraFiles(t *testing.T) {
|
||||
|
||||
tests := map[string]struct {
|
||||
extraFiles []config.ExtraFile
|
||||
ids []string
|
||||
want []string
|
||||
}{
|
||||
"default": {
|
||||
@ -256,6 +257,15 @@ func TestPipeCheckSumsWithExtraFiles(t *testing.T) {
|
||||
extraFileBar,
|
||||
},
|
||||
},
|
||||
"one extra file with no builds": {
|
||||
extraFiles: []config.ExtraFile{
|
||||
{Glob: extraFileFooRelPath},
|
||||
},
|
||||
ids: []string{"yada yada yada"},
|
||||
want: []string{
|
||||
extraFileFoo,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tt := range tests {
|
||||
@ -271,6 +281,7 @@ func TestPipeCheckSumsWithExtraFiles(t *testing.T) {
|
||||
Algorithm: "sha256",
|
||||
NameTemplate: "checksums.txt",
|
||||
ExtraFiles: tt.extraFiles,
|
||||
IDs: tt.ids,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user