Version: stamp v1.28.2/masyunis
The Makefile build and prebaked-build targets now stamp Version=v$(VERSION)/masyunis via -ldflags. anubis.go keeps a link-time stamp instead of overwriting it with the VCS/module version from debug.ReadBuildInfo, and appends /masyunis when it does fall back to the module version. go run/go test still see 'devel'.
This commit is contained in:
1 parent
d19efd2dd2
commit
20021cb14f
2 files changed
+20
-7
No files matched your search
@@ -1,4 +1,6 @@
|
||||
VERSION= $(shell cat ./VERSION)
|
||||
VERSION_STRING= v$(VERSION)/masyunis
|
||||
LDFLAGS_VERSION= -X 'github.com/TecharoHQ/anubis.Version=$(VERSION_STRING)'
|
||||
GO?= go
|
||||
NPM?= npm
|
||||
|
||||
@@ -19,8 +21,8 @@ assets: deps
|
||||
./xess/build.sh
|
||||
|
||||
build: assets
|
||||
$(GO) build -o ./var/anubis ./cmd/anubis
|
||||
$(GO) build -o ./var/robots2policy ./cmd/robots2policy
|
||||
$(GO) build -o ./var/anubis -ldflags "$(LDFLAGS_VERSION)" ./cmd/anubis
|
||||
$(GO) build -o ./var/robots2policy -ldflags "$(LDFLAGS_VERSION)" ./cmd/robots2policy
|
||||
@echo "Anubis is now built to ./var/anubis"
|
||||
|
||||
lint: assets
|
||||
@@ -28,8 +30,8 @@ lint: assets
|
||||
$(GO) tool staticcheck ./...
|
||||
|
||||
prebaked-build:
|
||||
$(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
|
||||
$(GO) build -o ./var/robots2policy -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/robots2policy
|
||||
$(GO) build -o ./var/anubis -ldflags "$(LDFLAGS_VERSION)" ./cmd/anubis
|
||||
$(GO) build -o ./var/robots2policy -ldflags "$(LDFLAGS_VERSION)" ./cmd/robots2policy
|
||||
|
||||
test: assets
|
||||
$(GO) test ./...
|
||||
Reference in new issue
Block a user