diff --git a/.goreleaser.yml b/.goreleaser.yml index 5622a23..d822208 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,6 +4,15 @@ before: builds: - env: - CGO_ENABLED=0 + ldflags: + - -s -w -X github.com/kunickiaj/beer/cmd.version={{.Version}} + goos: + - darwin + - linux + goarch: + - amd64 + - arm + - arm64 archives: - id: dist replacements: diff --git a/cmd/root.go b/cmd/root.go index ac041fa..1226fb7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -31,10 +31,13 @@ var ( gerritConfig GerritConfig ) +var version string // set at build time + // RootCmd represents the base command when called without any subcommands var RootCmd = &cobra.Command{ - Use: "beer", - Short: "CLI for managing your JIRA / Gerrit / git workflow.", + Use: "beer", + Version: version, + Short: "CLI for managing your JIRA / Gerrit / git workflow.", Long: `Beer Review is a CLI for managing your JIRA <--> Gerrit workflow. It can be used to create new tickets, work on existing ones, and submit reviews.