From 79469477943f0a91f07afb4fc53afe257c1f9ca0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Tue, 3 Nov 2026 20:49:00 -0700 Subject: [PATCH] Added version injection and `release` recipe. --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 5b670f7..51a9b10 100644 --- a/Makefile +++ b/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 +