From ddaf8f63bc0e77930da4762fc31afa1c9d439b05 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 29 Jul 2026 21:46:26 +0200 Subject: build: add ci + release targets, a pre-push hook, and a CHANGELOG Process hygiene so the version never silently drifts again and the two build-tag test sets stay green. - `make ci`: gofmt-clean + go vet + `go test ./...` (default tags) AND `make test` (-tags fullbible + corpus checks). The default-tag suite is easy to forget (only fullbible embeds the corpora), so ci runs both. - scripts/hooks/pre-push + `make install-hooks`: run `make ci` before any push (bypass with --no-verify). - `make release VERSION=x.y.z`: refuse a dirty tree or a missing CHANGELOG entry, bump const Version, run ci, commit, and tag vX.Y.Z (prints the push command -- publishing stays a manual choice). - CHANGELOG.md: terse, one line per release, starting at the first tags. --- CHANGELOG.md | 10 ++++++++++ Makefile | 24 +++++++++++++++++++++++- scripts/hooks/pre-push | 5 +++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md create mode 100644 scripts/hooks/pre-push diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..206da85 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +One line per release. Versions are git tags (`vX.Y.Z`); tagging began at 0.45.0, +so earlier history lives only in the git log. + +## [0.45.1] - 2026-07-29 +- Printed month calendar names the form in full: "traditional roman calendar" / "novus ordo calendar". + +## [0.45.0] - 2026-07-29 +- Any-language localisation (day/saint names + UI chrome as data), bible-corpora licence split (only the Vulgate embedded; wuj/drb/grb opt-in), EF Polish sanctoral complete, web top-bar rework. diff --git a/Makefile b/Makefile index 4719a6d..5fc9b59 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PREFIX ?= $(HOME)/.local BINDIR := $(PREFIX)/bin MANDIR := $(PREFIX)/share/man/man1 -.PHONY: help build build-full install install-full uninstall test vet fmt clean cross check-corpora add-corpus +.PHONY: help build build-full install install-full uninstall test vet fmt clean cross check-corpora add-corpus ci release install-hooks help: ## show this help @grep -hE '^[a-z-]+:.*##' $(MAKEFILE_LIST) | sed -E 's/:.*## /\t/' | sort build: ## build all three binaries (embeds only the Vulgate) @@ -40,6 +40,28 @@ vet: ## go vet go vet ./... fmt: ## gofmt the tree gofmt -w . +ci: ## full pre-push gate: gofmt clean, vet, both tag sets, corpora + @u=$$(gofmt -l .); test -z "$$u" || { echo "gofmt needed:"; echo "$$u"; exit 1; } + go vet ./... + go test ./... + $(MAKE) test +install-hooks: ## install the git pre-push hook (runs make ci) + @mkdir -p .git/hooks + @cp scripts/hooks/pre-push .git/hooks/pre-push + @chmod +x .git/hooks/pre-push + @echo "installed .git/hooks/pre-push -> runs 'make ci' (bypass a push with --no-verify)" +release: ## cut a release: make release VERSION=0.46.0 (add its CHANGELOG line first) + @test -n "$(VERSION)" || { echo "set VERSION=X.Y.Z" >&2; exit 2; } + @echo "$(VERSION)" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$$' || { echo "VERSION must be X.Y.Z" >&2; exit 2; } + @test -z "$$(git status --porcelain)" || { echo "working tree not clean; commit or stash first" >&2; exit 2; } + @grep -q '## \[$(VERSION)\]' CHANGELOG.md || { echo "add a one-line CHANGELOG.md entry under '## [$(VERSION)]' first" >&2; exit 2; } + @sed -i 's/^const Version = ".*"/const Version = "$(VERSION)"/' internal/config/config.go + @grep -q 'const Version = "$(VERSION)"' internal/config/config.go || { echo "version bump failed" >&2; exit 2; } + $(MAKE) ci + git add internal/config/config.go CHANGELOG.md + git commit -m "release: v$(VERSION)" + git tag -a "v$(VERSION)" -m "lectio $(VERSION)" + @echo "tagged v$(VERSION). publish with: git push origin main v$(VERSION)" clean: ## remove build artifacts rm -f $(LECTIO) $(LECTIO_UI) $(LECTIO_WEB); rm -rf dist cross: ## cross-compile into dist/ diff --git a/scripts/hooks/pre-push b/scripts/hooks/pre-push new file mode 100644 index 0000000..c4fbcaf --- /dev/null +++ b/scripts/hooks/pre-push @@ -0,0 +1,5 @@ +#!/bin/sh +# lectio pre-push hook: refuse to push if the CI gate fails (gofmt, vet, both +# build-tag test sets, corpora). Install with `make install-hooks`. +# Bypass in a pinch with `git push --no-verify`. +exec make -C "$(git rev-parse --show-toplevel)" ci -- cgit v1.3