.PHONY: build publish release

# Build wheel and source distribution
build:
	python3 -m build

# Publish to PyPI
# Requires PyPI credentials via ~/.pypirc or trusted publishing.
publish: build
	python3 -m twine upload dist/*

# Release: bump version, commit, tag.
# Usage: make release VERSION=0.2.0
release:
	@test -n "$(VERSION)" || (echo "Usage: make release VERSION=x.y.z"; exit 1)
	@echo "Setting version to $(VERSION)..."
	@echo '__version__ = "$(VERSION)"' > src/sensorswave/__version__.py
	git add src/sensorswave/__version__.py
	git commit -m "chore: bump version to $(VERSION)"
	git tag v$(VERSION)
	@echo "Committed and tagged v$(VERSION). Push with:"
	@echo "  git push && git push --tags"
