chore(binary): support LDFLAGS by goreleaser

fix https://github.com/appleboy/gorush/issues/713
This commit is contained in:
Bo-Yi Wu
2023-02-27 16:11:07 +08:00
parent 9b67d16e17
commit 5af237945e
3 changed files with 20 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ TARGETS ?= linux darwin windows
ARCHS ?= amd64
GOFILES := $(shell find . -name "*.go" -type f)
TAGS ?= sqlite
LDFLAGS ?= -X 'main.Version=$(VERSION)'
LDFLAGS ?= -X main.version=$(VERSION) -X main.commit=$(COMMIT)
PROTOC_GEN_GO=v1.28
PROTOC_GEN_GO_GRPC=v1.2
@@ -27,6 +27,8 @@ else
VERSION ?= $(shell git describe --tags --always || git rev-parse --short HEAD)
endif
COMMIT ?= $(shell git rev-parse --short HEAD)
.PHONY: all
all: build