From 7f73d6885bba569f8ba566e1692c0d9ff35997f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20T=C3=B6rnberg?= Date: Tue, 25 Aug 2026 09:26:58 +0200 Subject: [PATCH] Add cmsctl release workflow + makefile install targets - platform/Makefile: 'cmsctl' build target (static CGO_ENABLED=0) and 'install-cmsctl' to ~/.local/bin (BIN_DIR overridable) - .gitea/workflows/cmsctl-release.yml: tag-driven (cmsctl-v*) Gitea release action building linux/darwin amd64+arm64 binaries + sha256s --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Makefile b/Makefile index 026f69b..590d036 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,26 @@ +# ━━━ cmsctl build + install ━━━ +# Builds the cmsctl CLI. Pure Go, no cgo/build tags needed. +# +# make cmsctl # build to ./bin/cmsctl +# make install-cmsctl # build + install to ~/.local/bin +# +# Override BIN_DIR to install elsewhere: make install-cmsctl BIN_DIR=/usr/local/bin +BIN_DIR ?= $(HOME)/.local/bin + +.PHONY: cmsctl install-cmsctl +cmsctl: + @mkdir -p bin + CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bin/cmsctl ./cmd/cmsctl + @echo "Built bin/cmsctl" + +install-cmsctl: cmsctl + @mkdir -p $(BIN_DIR) + @cp bin/cmsctl $(BIN_DIR)/cmsctl + @chmod 0755 $(BIN_DIR)/cmsctl + @echo "Installed $(BIN_DIR)/cmsctl" + # ━━━ Pre-commit hook (forbid root binaries) ━━━ .PHONY: install-hooks install-hooks: