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

fix: meta archives make the other archives be ignored (#3804)

This commit is contained in:
Carlos Alexandro Becker 2023-02-24 14:58:09 -03:00 committed by GitHub
parent 2b454c283f
commit 4f7475eee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 1 deletions

View File

@ -92,7 +92,10 @@ func (Pipe) Run(ctx *context.Context) error {
for i, archive := range ctx.Config.Archives {
archive := archive
if archive.Meta {
return createMeta(ctx, archive)
g.Go(func() error {
return createMeta(ctx, archive)
})
continue
}
filter := []artifact.Filter{artifact.Or(

View File

@ -1148,3 +1148,32 @@ func TestInvalidFormat(t *testing.T) {
})
require.EqualError(t, Pipe{}.Run(ctx), "invalid archive format: 7z")
}
func TestIssue3803(t *testing.T) {
ctx := context.New(config.Project{
Dist: t.TempDir(),
Archives: []config.Archive{
{
ID: "foo",
NameTemplate: "foo",
Meta: true,
Format: "zip",
Files: []config.File{
{Source: "./testdata/a/a.txt"},
},
},
{
ID: "foobar",
NameTemplate: "foobar",
Meta: true,
Format: "zip",
Files: []config.File{
{Source: "./testdata/a/b/a.txt"},
},
},
},
})
require.NoError(t, Pipe{}.Run(ctx))
archives := ctx.Artifacts.List()
require.Len(t, archives, 2)
}