From e158255d9b905c845fc5acd9c2642d9e2953a8af Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Wed, 21 Oct 2020 23:12:18 -0400 Subject: [PATCH] Get the build version from a static file --- Makefile | 4 ++-- build_version.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 build_version.txt diff --git a/Makefile b/Makefile index bb7eb8f33..eebd15c30 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -next_version := 1.17.0 +next_version := $(shell cat build_version.txt) tag := $(shell git describe --exact-match --tags 2>git_describe_error.tmp; rm -f git_describe_error.tmp) branch := $(shell git rev-parse --abbrev-ref HEAD) commit := $(shell git rev-parse --short=8 HEAD) @@ -41,7 +41,7 @@ GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) HOSTGO := env -u GOOS -u GOARCH -u GOARM -- go -LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch) +LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch) -X main.goos=$(GOOS) -X main.goarch=$(GOARCH) ifneq ($(tag),) LDFLAGS += -X main.version=$(version) endif diff --git a/build_version.txt b/build_version.txt new file mode 100644 index 000000000..092afa15d --- /dev/null +++ b/build_version.txt @@ -0,0 +1 @@ +1.17.0