diff --git a/internal/pipe/nfpm/nfpm.go b/internal/pipe/nfpm/nfpm.go index f0d581a6c99..815fee29b9a 100644 --- a/internal/pipe/nfpm/nfpm.go +++ b/internal/pipe/nfpm/nfpm.go @@ -146,7 +146,7 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries Arch: arch, Platform: "linux", Name: ctx.Config.ProjectName, - Version: ctx.Git.CurrentTag, + Version: ctx.Version, Section: "", Priority: "", Epoch: fpm.Epoch, diff --git a/internal/pipe/nfpm/nfpm_test.go b/internal/pipe/nfpm/nfpm_test.go index 839f055ec3f..4552501816a 100644 --- a/internal/pipe/nfpm/nfpm_test.go +++ b/internal/pipe/nfpm/nfpm_test.go @@ -20,6 +20,7 @@ func TestDescription(t *testing.T) { func TestRunPipeNoFormats(t *testing.T) { var ctx = &context.Context{ + Version: "1.0.0", Git: context.GitInfo{ CurrentTag: "v1.0.0", }, @@ -45,6 +46,7 @@ func TestRunPipeInvalidFormat(t *testing.T) { }, }, }) + ctx.Version = "1.2.3" ctx.Git = context.GitInfo{ CurrentTag: "v1.2.3", } @@ -211,6 +213,7 @@ func TestCreateFileDoesntExist(t *testing.T) { }, }, }) + ctx.Version = "1.2.3" ctx.Git = context.GitInfo{ CurrentTag: "v1.2.3", }