···11+MIT License
22+33+Copyright (c) 2025 Simon Späti
44+55+Permission is hereby granted, free of charge, to any person obtaining a copy
66+of this software and associated documentation files (the "Software"), to deal
77+in the Software without restriction, including without limitation the rights
88+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+copies of the Software, and to permit persons to whom the Software is
1010+furnished to do so, subject to the following conditions:
1111+1212+The above copyright notice and this permission notice shall be included in all
1313+copies or substantial portions of the Software.
1414+1515+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121+SOFTWARE.
+16-7
Makefile
···11BINARY := neomd
22CMD := ./cmd/neomd
33INSTALL := $(HOME)/.local/bin
44+VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
55+LDFLAGS := -ldflags "-X main.version=$(VERSION)"
4655-.PHONY: build run install clean test vet fmt lint tidy
77+.PHONY: build run install clean test vet fmt tidy release help
6877-## build: compile the binary into ./neomd
99+## build: compile ./neomd (version from git tag)
810build:
99- go build -o $(BINARY) $(CMD)
1111+ go build $(LDFLAGS) -o $(BINARY) $(CMD)
10121111-## run: build and run (pass ARGS="--config /path/to/config.toml" to override)
1313+## run: build and run
1214run: build
1315 ./$(BINARY) $(ARGS)
14161515-## install: install the binary to ~/.local/bin
1717+## install: install to ~/.local/bin
1618install: build
1719 install -Dm755 $(BINARY) $(INSTALL)/$(BINARY)
1820 @echo "Installed to $(INSTALL)/$(BINARY)"
···3335tidy:
3436 go mod tidy
35373636-## clean: remove the compiled binary
3838+## clean: remove compiled binary
3739clean:
3840 rm -f $(BINARY)
39414040-## help: print this help
4242+## release: tag and push a new release (usage: make release VERSION=v0.1.0)
4343+release:
4444+ @test -n "$(VERSION)" || (echo "Usage: make release VERSION=v0.1.0" && exit 1)
4545+ git tag -a $(VERSION) -m "Release $(VERSION)"
4646+ git push origin $(VERSION)
4747+ @echo "Tagged $(VERSION) — GitHub Actions will build and publish the release."
4848+4949+## help: print this list
4150help:
4251 @grep -E '^## ' Makefile | sed 's/^## //'