Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ RELEASE_DIR = release
# Override on the command line or in CI (matches the ldflags of the release workflow).
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null)
TAG ?= $(shell git describe --tags --exact-match 2>/dev/null)
COMMIT ?= $(shell git rev-parse HEAD 2>/dev/null || echo "")
# -dirty when the working tree has changes, as Go itself marks vcs.modified
# (git status --porcelain, untracked files included); empty outside git.
DIRTY := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] || echo -dirty)
COMMIT ?= $(shell git rev-parse HEAD 2>/dev/null || echo "")$(DIRTY)
BUILD_DATE ?= $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS = -ldflags "-s -w -X main.version=$(VERSION) -X main.tag=$(TAG) -X main.commit=$(COMMIT) -X main.buildDate=$(BUILD_DATE)"

Expand Down
Loading