From ac19f902b4603ab81b14e08567dba7056d179e37 Mon Sep 17 00:00:00 2001 From: Matthew Bamber Date: Thu, 13 Apr 2023 15:42:58 +0100 Subject: [PATCH] fix(nfpm): Add extension to produced artifacts (#3940) Add extension to produced artifacts so that they can be filtered in later steps Fixes #3933 Co-authored-by: Carlos A Becker --- internal/pipe/nfpm/nfpm.go | 1 + internal/pipe/nfpm/nfpm_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/pipe/nfpm/nfpm.go b/internal/pipe/nfpm/nfpm.go index ed22c4903..1fc5e76b4 100644 --- a/internal/pipe/nfpm/nfpm.go +++ b/internal/pipe/nfpm/nfpm.go @@ -443,6 +443,7 @@ func create(ctx *context.Context, fpm config.NFPM, format string, binaries []*ar artifact.ExtraBuilds: binaries, artifact.ExtraID: fpm.ID, artifact.ExtraFormat: format, + artifact.ExtraExt: format, extraFiles: contents, }, }) diff --git a/internal/pipe/nfpm/nfpm_test.go b/internal/pipe/nfpm/nfpm_test.go index 21e23af1e..57809ae8a 100644 --- a/internal/pipe/nfpm/nfpm_test.go +++ b/internal/pipe/nfpm/nfpm_test.go @@ -281,6 +281,7 @@ func TestRunPipe(t *testing.T) { for _, pkg := range packages { format := pkg.Format() require.NotEmpty(t, format) + require.Equal(t, pkg.Format(), artifact.ExtraOr(*pkg, artifact.ExtraExt, "")) arch := pkg.Goarch if pkg.Goarm != "" { arch += "v" + pkg.Goarm