diff --git a/.goreleaser.yml b/.goreleaser.yml index 2cd49c9..b717dd9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 @@ -63,7 +63,7 @@ snapcrafts: - $HOME/.config/kafkactl/config.yml brews: - - tap: + repository: owner: deviceinsight name: homebrew-packages diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a9081a..271a382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## 5.0.2 - 2024-03-08 + ## 5.0.1 - 2024-03-08 ## 5.0.0 - 2024-03-08 diff --git a/Makefile b/Makefile index b97ce2c..552c604 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ 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 -ld_flags := "-X $(project)/cmd.Version=$(VERSION) -X $(project)/cmd.GitCommit=$(COMMIT_SHA) -X $(project)/cmd.BuildTime=$(BUILD_TS)" +module=$(shell go list -m) +ld_flags := "-X $(module)/cmd.Version=$(VERSION) -X $(module)/cmd.GitCommit=$(COMMIT_SHA) -X $(module)/cmd.BuildTime=$(BUILD_TS)" FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go') TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go') diff --git a/cmd/version.go b/cmd/version.go index 17838b7..f5619d4 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -var Version string +var Version = "latest" var BuildTime string var GitCommit string