|
1 | 1 | # Makefile for l9format-python project |
2 | 2 |
|
| 3 | +VERSION := $(shell poetry version -s) |
| 4 | + |
3 | 5 | UNAME_S := $(shell uname -s) |
4 | 6 | ifeq ($(UNAME_S),Darwin) |
5 | 7 | SED := $(shell command -v gsed 2>/dev/null) |
@@ -94,8 +96,34 @@ check-trailing-whitespace: ## Check for trailing whitespaces in source files |
94 | 96 | install: ## Install dependencies with Poetry |
95 | 97 | poetry install |
96 | 98 |
|
| 99 | +.PHONY: build |
| 100 | +build: clean-dist ## Build package for distribution |
| 101 | + poetry build |
| 102 | + |
| 103 | +.PHONY: publish-dry-run |
| 104 | +publish-dry-run: build ## Dry-run: show what would be published |
| 105 | + @echo "Would publish l9format v$(VERSION)" |
| 106 | + @echo "Would create tag: v$(VERSION)" |
| 107 | + @echo "Would create GitHub release: v$(VERSION)" |
| 108 | + @echo "Package contents:" |
| 109 | + @ls -lh dist/ |
| 110 | + poetry publish --dry-run |
| 111 | + |
| 112 | +.PHONY: publish |
| 113 | +publish: build ## Publish to PyPI, tag and create GitHub release |
| 114 | + poetry publish |
| 115 | + git tag -a "v$(VERSION)" -m "Release v$(VERSION)" |
| 116 | + git push origin "v$(VERSION)" |
| 117 | + gh release create "v$(VERSION)" dist/* \ |
| 118 | + --title "v$(VERSION)" \ |
| 119 | + --notes "Release v$(VERSION)" |
| 120 | + |
| 121 | +.PHONY: clean-dist |
| 122 | +clean-dist: ## Clean distribution artifacts |
| 123 | + rm -rf dist/ |
| 124 | + |
97 | 125 | .PHONY: clean |
98 | | -clean: ## Clean build artifacts and caches |
| 126 | +clean: clean-dist ## Clean build artifacts and caches |
99 | 127 | rm -rf __pycache__ .pytest_cache .mypy_cache .ruff_cache |
100 | 128 | find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true |
101 | 129 | find . -type f -name "*.pyc" -delete 2>/dev/null || true |
0 commit comments