-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 1.5 KB
/
Makefile
File metadata and controls
42 lines (32 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.PHONY: lint typecheck test all \
changelog changelog-preview changelog-bump release
# ── CI / quality ────────────────────────────────────────────────────────────
lint:
ruff check .
typecheck:
mypy src/
test:
pytest --cov=src --cov-report=term-missing
all: lint typecheck test
# ── Changelog / release ──────────────────────────────────────────────────────
# Preview what the next changelog entry will look like (dry-run, no files changed)
changelog-preview:
git cliff --unreleased --bump
# Show what the next version number will be
changelog-bump:
git cliff --unreleased --bumped-version
# Prepend new entries to CHANGELOG.md for the next release
changelog:
$(eval VERSION := $(shell git cliff --unreleased --bumped-version 2>/dev/null))
touch CHANGELOG.md
git cliff --unreleased --prepend CHANGELOG.md --bump
@echo "CHANGELOG.md updated to $(VERSION). Review, then run: make release"
# Full release: update changelog, commit, tag, push
release:
$(eval VERSION := $(shell git cliff --unreleased --bumped-version 2>/dev/null))
git add CHANGELOG.md
@git commit -m "chore: release $(VERSION)" || { echo "Error: CHANGELOG.md unchanged. Run 'make changelog' first."; exit 1; }
git tag $(VERSION)
git push origin main
git push origin $(VERSION)
@echo "Released $(VERSION)"