diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | RELEASE.md | 8 | ||||
-rw-r--r-- | VERSION.txt | 1 | ||||
-rw-r--r-- | version.go | 4 |
4 files changed, 14 insertions, 5 deletions
@@ -2,16 +2,14 @@ TARGET_EXEC := ceres BUILD_DIR := ./build MODULE_NAME := xengineering.eu/ceres -VERSION := $(shell git describe --dirty --always) - all: $(BUILD_DIR)/$(TARGET_EXEC) $(BUILD_DIR)/$(TARGET_EXEC): - go build -ldflags "-X main.version=$(VERSION)" -o $@ $(MODULE_NAME) + go build -o $@ $(MODULE_NAME) .PHONY: debug debug: - go run -race -ldflags "-X main.version=$(VERSION)" $(MODULE_NAME) -e + go run -race $(MODULE_NAME) -e .PHONY: tests tests: diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..b403a31 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,8 @@ +# Release checklist + +- remove `-devel` from VERSION.txt +- update CHANGELOG.md +- `go test ./...` must succeed +- release with `git tag -u <user> -m 'Release version <version>' 'v<version>' + with version as <major>.<minor>.<patch> (e.g. 0.2.3) +- remove `-devel` from VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..9e39250 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +0.4.0-devel @@ -2,12 +2,14 @@ package main import ( "log" + _ "embed" ) +//go:embed VERSION.txt var version string func init() { if version == "" { - log.Fatal("No version information passed to this via build flags") + log.Fatal("Bad build: No version string embedded.") } } |