From d8667ff15464c734d2085cb3d2332707d3341912 Mon Sep 17 00:00:00 2001 From: Andy Herzog Date: Fri, 12 Mar 2021 09:39:34 -0700 Subject: [PATCH] fix: version for release binaries --- .goreleaser.yml | 5 +++++ .../{build-info/build_info.go => buildinfo/buildinfo.go} | 0 internal/cli/cli.go | 2 +- internal/cli/root.go | 5 +++-- 4 files changed, 9 insertions(+), 3 deletions(-) rename internal/{build-info/build_info.go => buildinfo/buildinfo.go} (100%) diff --git a/.goreleaser.yml b/.goreleaser.yml index d2ce60741..42f9bd3c6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,6 +10,11 @@ builds: - linux - windows binary: auth0 + ldflags: + - -X github.com/auth0/auth0-cli/internal/buildinfo.Version={{.Version}} + - -X github.com/auth0/auth0-cli/internal/buildinfo.Revision={{.Commit}} + - -X github.com/auth0/auth0-cli/internal/buildinfo.BuildUser=goreleaser' + - -X github.com/auth0/auth0-cli/internal/buildinfo.BuildDate={{.Date}}' archives: - replacements: darwin: Darwin diff --git a/internal/build-info/build_info.go b/internal/buildinfo/buildinfo.go similarity index 100% rename from internal/build-info/build_info.go rename to internal/buildinfo/buildinfo.go diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 47a3cb31b..1e2c36e73 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -17,7 +17,7 @@ import ( "github.com/auth0/auth0-cli/internal/ansi" "github.com/auth0/auth0-cli/internal/auth" "github.com/auth0/auth0-cli/internal/auth0" - "github.com/auth0/auth0-cli/internal/build-info" + "github.com/auth0/auth0-cli/internal/buildinfo" "github.com/auth0/auth0-cli/internal/display" "github.com/lestrrat-go/jwx/jwt" "github.com/spf13/cobra" diff --git a/internal/cli/root.go b/internal/cli/root.go index 9003656b3..26ca3bc95 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -2,11 +2,12 @@ package cli import ( "context" + "os" + "github.com/auth0/auth0-cli/internal/ansi" - "github.com/auth0/auth0-cli/internal/build-info" + "github.com/auth0/auth0-cli/internal/buildinfo" "github.com/auth0/auth0-cli/internal/display" "github.com/spf13/cobra" - "os" ) // Execute is the primary entrypoint of the CLI app.