From 768eebdb7e7aabc94e753592cead9f78c5534f6d Mon Sep 17 00:00:00 2001 From: Richard Hagen Date: Thu, 12 Oct 2023 13:19:21 +0200 Subject: [PATCH] update version in goreleaser --- .goreleaser.yml | 2 ++ cmd/root.go | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index f6b2721..6e22c45 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -14,6 +14,8 @@ builds: - amd64 - arm - arm64 + ldflags: + - "-X 'github.com/equinor/radix-cli/cmd.Version={{ .Version }}'" dockers: - image_templates: - "ghcr.io/equinor/radix/rx:latest" diff --git a/cmd/root.go b/cmd/root.go index d92c43b..55d79f2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -22,9 +22,7 @@ const ( radixCLIError = "Error: Radix CLI executed with error" ) -//go:generate sh -c "printf %s $(git describe --tags) > tag.txt" -//go:embed tag.txt -var version string +var Version = "dev" var rootLongHelp = strings.TrimSpace(` A command line interface which allows you to interact with the Radix platform through automation. `) @@ -34,7 +32,7 @@ var rootCmd = &cobra.Command{ Use: "rx", Short: "Command line interface for Radix platform", Long: rootLongHelp, - Version: "version: " + version, + Version: Version, } // Execute the top level command