Report development builds as such, not as the release version
Only a release build (the commit tagged v<VERSION>, unchanged) gives a version number. Others print 'dev <commit> (3 commits after v0.2.0-rc.1)', from git describe (the Makefile's DESCRIBE), in jarld version, jarl --version, jarl status, jarl whoami and the startup log; a build without git says '(source build)'. The CLI's User-Agent and the footer's tooltip follow suit, and /status's build gains since and ahead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88bb89a9ff
commit
fb1ee09250
7 files changed
+123
-23
No files matched your search
@@ -18,7 +18,11 @@ VERSION ?= $(shell cat VERSION 2>/dev/null || echo 0.0.0-dev)
|
||||
# the release rather than the commit): set when HEAD is tagged v$(VERSION)
|
||||
# and no tracked file is changed.
|
||||
RELEASE_TAG ?= $(shell t=v$(VERSION); git tag --points-at HEAD 2>/dev/null | grep -qx "$$t" && git diff --quiet HEAD 2>/dev/null && echo $$t)
|
||||
LDFLAGS := -s -w -X jarl/internal/version.Version=$(VERSION) -X jarl/internal/version.Tag=$(RELEASE_TAG)
|
||||
# DESCRIBE places other builds relative to the last tag ("3 commits after
|
||||
# v0.2.0-rc.1").
|
||||
DESCRIBE ?= $(shell git describe --tags --long --match 'v[0-9]*' --abbrev=12 HEAD 2>/dev/null)
|
||||
LDFLAGS := -s -w -X jarl/internal/version.Version=$(VERSION) -X jarl/internal/version.Tag=$(RELEASE_TAG) \
|
||||
-X jarl/internal/version.Describe=$(DESCRIBE)
|
||||
GOFLAGS := -trimpath
|
||||
export CGO_ENABLED := 0
|
||||
|
||||
|
||||
Reference in new issue
Block a user