mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
include git tag in binary when available
This commit is contained in:
parent
9c4fbeabef
commit
f9ca172ad7
1 changed files with 3 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -1,16 +1,17 @@
|
||||||
.PHONY: all install build release capdefs test smoke gofmt irctest
|
.PHONY: all install build release capdefs test smoke gofmt irctest
|
||||||
|
|
||||||
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null)
|
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null)
|
||||||
|
GIT_TAG := $(shell git tag --points-at HEAD 2> /dev/null | head -n 1)
|
||||||
|
|
||||||
capdef_file = ./irc/caps/defs.go
|
capdef_file = ./irc/caps/defs.go
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -v -ldflags "-X main.commit=$(GIT_COMMIT)"
|
go install -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -v -ldflags "-X main.commit=$(GIT_COMMIT)"
|
go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
||||||
|
|
||||||
release:
|
release:
|
||||||
goreleaser --skip-publish --rm-dist
|
goreleaser --skip-publish --rm-dist
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue