Added version injection and release recipe.
This commit is contained in:
parent
6c7cf689aa
commit
7946947794
1 changed files with 14 additions and 0 deletions
14
Makefile
14
Makefile
|
|
@ -1,3 +1,8 @@
|
|||
#version := $(shell cat BOT_VERSION)
|
||||
version := 0.1.0
|
||||
revision := $(shell git rev-parse HEAD | head -c 8)
|
||||
revcount := $(shell git rev-list --count HEAD)
|
||||
suffix := amd64
|
||||
|
||||
TEST=.
|
||||
|
||||
|
|
@ -8,3 +13,12 @@ test:
|
|||
|
||||
build:
|
||||
go build ./cmd/bot
|
||||
|
||||
|
||||
release:
|
||||
go build \
|
||||
-ldflags="-s -w -X main.Version=$(version)-$(revision)" \
|
||||
-trimpath \
|
||||
-o build/bot-linux-$(suffix)/bot \
|
||||
./cmd/bot
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue