Create status-go API to return a current revision (#804)
Change `BUILD_FLAGS` in Makefile and update `github.com/status-im/status-go/geth/params.VersionMeta` value with the current Git SHA.
This commit is contained in:
parent
02309e81e9
commit
e34af8d6eb
3
Makefile
3
Makefile
|
@ -11,8 +11,9 @@ endif
|
||||||
|
|
||||||
CGO_CFLAGS=-I/$(JAVA_HOME)/include -I/$(JAVA_HOME)/include/darwin
|
CGO_CFLAGS=-I/$(JAVA_HOME)/include -I/$(JAVA_HOME)/include/darwin
|
||||||
GOBIN=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))build/bin
|
GOBIN=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))build/bin
|
||||||
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
BUILD_FLAGS := $(shell echo "-ldflags '-X main.buildStamp=`date -u '+%Y-%m-%d.%H:%M:%S'` -X main.gitCommit=$(git rev-parse HEAD)'")
|
BUILD_FLAGS := $(shell echo "-ldflags '-X main.buildStamp=`date -u '+%Y-%m-%d.%H:%M:%S'` -X main.gitCommit=$(GIT_COMMIT) -X github.com/status-im/status-go/geth/params.VersionMeta=$(GIT_COMMIT)'")
|
||||||
|
|
||||||
GO ?= latest
|
GO ?= latest
|
||||||
XGOVERSION ?= 1.9.2
|
XGOVERSION ?= 1.9.2
|
||||||
|
|
|
@ -13,10 +13,10 @@ const (
|
||||||
|
|
||||||
// VersionPatch is a patch version component of the current release
|
// VersionPatch is a patch version component of the current release
|
||||||
VersionPatch = 9
|
VersionPatch = 9
|
||||||
|
|
||||||
// VersionMeta is metadata to append to the version string
|
|
||||||
VersionMeta = "unstable"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// VersionMeta is metadata to append to the version string
|
||||||
|
var VersionMeta string // rely on linker: -ldflags -X github.com/status-im/status-go/geth/params.VersionMeta"
|
||||||
|
|
||||||
// Version exposes string representation of program version.
|
// Version exposes string representation of program version.
|
||||||
var Version = fmt.Sprintf("%d.%d.%d-%s", VersionMajor, VersionMinor, VersionPatch, VersionMeta)
|
var Version = fmt.Sprintf("%d.%d.%d-%s", VersionMajor, VersionMinor, VersionPatch, VersionMeta)
|
||||||
|
|
Loading…
Reference in New Issue