Skip to content

Commit 87b68f6

Browse files
committed
Makefile: add publish and publish-dry-run targets
1 parent 5bfebb5 commit 87b68f6

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

Makefile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,36 @@ help: ## Ask for help!
1010
install: ## Install dependencies
1111
uv sync
1212

13+
VERSION := $(shell python -c \
14+
"import tomllib; \
15+
print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
16+
1317
.PHONY: build
14-
build: ## Build the package
18+
build: clean-dist ## Build the package
1519
uv build
1620

21+
.PHONY: publish-dry-run
22+
publish-dry-run: build ## Dry-run: show what would be published
23+
@echo "Would publish leakix v$(VERSION)"
24+
@echo "Would create tag: v$(VERSION)"
25+
@echo "Would create GitHub release: v$(VERSION)"
26+
@echo "Package contents:"
27+
@ls -lh dist/
28+
uv publish --dry-run
29+
30+
.PHONY: publish
31+
publish: build ## Publish to PyPI, tag and create GitHub release
32+
uv publish
33+
git tag -a "v$(VERSION)" -m "Release v$(VERSION)"
34+
git push origin "v$(VERSION)"
35+
gh release create "v$(VERSION)" dist/* \
36+
--title "v$(VERSION)" \
37+
--notes "Release v$(VERSION)"
38+
39+
.PHONY: clean-dist
40+
clean-dist: ## Clean distribution artifacts
41+
rm -rf dist/
42+
1743
.PHONY: test
1844
test: ## Run tests
1945
uv run pytest

0 commit comments

Comments
 (0)