File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# This Makefile demonstrates how to build GABS with version information
33
44# Version information
5- VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
5+ # Use the declared source version for local builds so rebuilt workspace binaries
6+ # keep the release semantic version instead of inheriting a git "-dirty" suffix.
7+ SOURCE_VERSION ?= $(shell sed -n 's/^[[:space:]]* Version = "\([^"]* \) ".*/\1/p' internal/version/version.go | head -n 1)
8+ VERSION ?= $(if $(SOURCE_VERSION ) ,v$(SOURCE_VERSION ) ,dev)
69COMMIT ?= $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
710BUILD_DATE ?= $(shell date -u +% Y-% m-% dT% H:% M:% SZ)
811
@@ -44,6 +47,7 @@ install:
4447# Show version information that would be embedded
4548.PHONY : version-info
4649version-info :
50+ @echo " Source Version: $( SOURCE_VERSION) "
4751 @echo " Version: $( VERSION) "
4852 @echo " Commit: $( COMMIT) "
4953 @echo " Build Date: $( BUILD_DATE) "
You can’t perform that action at this time.
0 commit comments