Skip to content

Commit

Permalink
fix version reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rk committed Mar 8, 2024
1 parent 53a3579 commit 1bceb2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/deviceinsight/kafkactl/cmd.Version={{.Tag}} -X github.com/deviceinsight/kafkactl/cmd.GitCommit={{.ShortCommit}} -X github.com/deviceinsight/kafkactl/cmd.BuildTime={{.Date}}
- -s -w -X {{ .ModulePath }}/cmd.Version={{.Tag}} -X {{ .ModulePath }}/cmd.GitCommit={{.ShortCommit}} -X {{ .ModulePath }}/cmd.BuildTime={{.Date}}
goos:
- darwin
- linux
Expand Down Expand Up @@ -63,7 +63,7 @@ snapcrafts:
- $HOME/.config/kafkactl/config.yml
brews:
-
tap:
repository:
owner: deviceinsight
name: homebrew-packages

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
BUILD_TS := $(shell date -Iseconds --utc)
COMMIT_SHA := $(shell git rev-parse HEAD)
VERSION := $(shell git describe --abbrev=0 --tags)
VERSION := $(shell git describe --abbrev=0 --tags || echo "latest")

export CGO_ENABLED=0
export GOOS=linux
export GO111MODULE=on

project=github.com/deviceinsight/kafkactl
project=$(shell go list -m)
ld_flags := "-X $(project)/cmd.Version=$(VERSION) -X $(project)/cmd.GitCommit=$(COMMIT_SHA) -X $(project)/cmd.BuildTime=$(BUILD_TS)"

FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)

var Version string
var Version = "latest"
var BuildTime string
var GitCommit string

Expand Down

0 comments on commit 1bceb2f

Please sign in to comment.