Skip to content

Commit 2a0fa36

Browse files
authored
Makefile: add publish and publish-dry-run targets (#80)
* Makefile: add publish and publish-dry-run targets * CHANGELOG: add publish and publish-dry-run targets
1 parent 5bfebb5 commit 2a0fa36

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ and this project adheres to
5252
- Add mypy type checking to CI workflow ([6b9a3db], [#42])
5353
- Bump astral-sh/setup-uv from 6 to 7 ([cfa8b6c], [#72])
5454
- Migrate from Poetry to uv ([14bc55e], [#65])
55+
- Makefile: add `publish` and `publish-dry-run` targets ([87b68f6], [#80])
5556

5657
## [0.1.10] - 2024-12-XX
5758

@@ -88,6 +89,7 @@ and this project adheres to
8889
[0.1.9]: https://github.com/LeakIX/LeakIXClient-Python/releases/tag/v0.1.9
8990

9091
<!-- Commit links -->
92+
[87b68f6]: https://github.com/LeakIX/LeakIXClient-Python/commit/87b68f6
9193
[c62d2a4]: https://github.com/LeakIX/LeakIXClient-Python/commit/c62d2a4
9294
[01b280f]: https://github.com/LeakIX/LeakIXClient-Python/commit/01b280f
9395
[aa9cc03]: https://github.com/LeakIX/LeakIXClient-Python/commit/aa9cc03
@@ -119,3 +121,4 @@ and this project adheres to
119121
[#75]: https://github.com/LeakIX/LeakIXClient-Python/pull/75
120122
[#76]: https://github.com/LeakIX/LeakIXClient-Python/pull/76
121123
[#78]: https://github.com/LeakIX/LeakIXClient-Python/pull/78
124+
[#80]: https://github.com/LeakIX/LeakIXClient-Python/pull/80

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)