-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 2.14 KB
/
Copy pathMakefile
File metadata and controls
65 lines (48 loc) · 2.14 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: test lint format release-notes release-notes-file release-notes-publish release release-prepare release-publish release-patch release-minor release-major release-validate sources sources-check
test:
@uv run --extra dev pytest
lint:
@uv run --extra dev ruff check
format:
@uv run --extra dev ruff format
release-validate:
@test -n "$(VERSION)" || (echo "Error: Set VERSION=x.y.z" && exit 1)
@echo "Checking pyproject.toml version..."
@FILE_VERSION=$$(awk -F'"' '/^version/ {print $$2; exit}' pyproject.toml); \
if [ "$(VERSION)" != "$$FILE_VERSION" ]; then \
echo "Error: VERSION=$(VERSION) does not match pyproject.toml version=$$FILE_VERSION"; \
exit 1; \
fi
@echo "Checking docs/changelog.md for [$(VERSION)] section..."
@if ! grep -q "^## \[$(VERSION)\]" docs/changelog.md; then \
echo "Error: No ## [$(VERSION)] section found in docs/changelog.md"; \
echo "Add release notes to docs/changelog.md before publishing."; \
exit 1; \
fi
@echo "Checking user-visible release content..."
@uv run --extra dev python scripts/validate_release_content.py
@echo "Release validation passed for v$(VERSION)"
release-notes: release-validate
@uv run python scripts/release_notes.py $(VERSION)
release-notes-file: release-validate
@uv run python scripts/release_notes.py $(VERSION) > /tmp/news-watch-v$(VERSION)-notes.md
@echo /tmp/news-watch-v$(VERSION)-notes.md
release-notes-publish: release-validate
@uv run python scripts/release_notes.py $(VERSION) > /tmp/news-watch-v$(VERSION)-notes.md
@gh release edit v$(VERSION) --notes-file /tmp/news-watch-v$(VERSION)-notes.md
release: release-publish
release-prepare:
@test -n "$(VERSION)" || (echo "Error: Set VERSION=x.y.z" && exit 1)
@uv run python scripts/version.py prepare "$(VERSION)"
release-patch:
@uv run python scripts/version.py prepare --patch
release-minor:
@uv run python scripts/version.py prepare --minor
release-major:
@uv run python scripts/version.py prepare --major
release-publish: release-validate
@uv run python scripts/version.py publish "$(VERSION)"
sources:
@uv run python scripts/generate_sources.py
sources-check:
@uv run python scripts/generate_sources.py --check