chore: Makefile release target with versioned builds
This commit is contained in:
parent
19d16b1e4a
commit
c64f12a360
1 changed files with 14 additions and 2 deletions
16
Makefile
16
Makefile
|
|
@ -1,7 +1,8 @@
|
||||||
.PHONY: all linux-amd64 linux-arm64 clean test
|
.PHONY: all linux-amd64 linux-arm64 clean test release
|
||||||
|
|
||||||
BINARY := wallarm
|
BINARY := wallarm
|
||||||
LDFLAGS := -s -w
|
VERSION := $(shell git describe --tags --always 2>/dev/null || echo "dev")
|
||||||
|
LDFLAGS := -s -w -X main.version=$(VERSION)
|
||||||
# Embed tunnel key at build time: make TUNNEL_KEY=~/.wallarm/tunnel_key
|
# Embed tunnel key at build time: make TUNNEL_KEY=~/.wallarm/tunnel_key
|
||||||
ifdef TUNNEL_KEY
|
ifdef TUNNEL_KEY
|
||||||
LDFLAGS += -X main.tunnelKey=$(shell cat $(TUNNEL_KEY))
|
LDFLAGS += -X main.tunnelKey=$(shell cat $(TUNNEL_KEY))
|
||||||
|
|
@ -20,3 +21,14 @@ clean:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test ./internal/...
|
go test ./internal/...
|
||||||
|
|
||||||
|
# Build and prepare for Gitea release.
|
||||||
|
# Usage: make release
|
||||||
|
# Then upload wallarm-linux-amd64 and wallarm-linux-arm64 as release assets.
|
||||||
|
release: clean all
|
||||||
|
@echo "Release binaries built:"
|
||||||
|
@ls -lh wallarm-linux-*
|
||||||
|
@echo ""
|
||||||
|
@echo "Next: Create a Gitea release and upload these binaries as assets."
|
||||||
|
@echo " Tag: v$(VERSION)"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue