diff --git a/Makefile b/Makefile index 95ee7378..29206b44 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +LATEST_STABLE := $(or $(shell git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' | head -1),v0.0.0) +CURRENT_MAJOR := $(shell echo $(LATEST_STABLE) | sed 's/^v//' | cut -d. -f1) +CURRENT_MINOR := $(shell echo $(LATEST_STABLE) | sed 's/^v//' | cut -d. -f2) +CURRENT_BUILD := $(shell echo $(LATEST_STABLE) | sed 's/^v//' | cut -d. -f3) + setup: @echo "Checking prerequisites..." @python3 --version @@ -35,4 +40,27 @@ lint-skills: uv run python scripts/validate_agent_guidance.py smoke-skills: - scripts/smoke-test-skills.sh \ No newline at end of file + scripts/smoke-test-skills.sh + +release: + @if [ -z "$(VERSION)" ]; then \ + echo "Usage: make release VERSION=0.3.0"; \ + exit 1; \ + fi + @echo "Creating release v$(VERSION)..." + git tag -a "v$(VERSION)" -m "v$(VERSION)" + git push origin "v$(VERSION)" + @echo "Tag v$(VERSION) pushed. CI will publish to PyPI." + +patch-release: VERSION = $(CURRENT_MAJOR).$(CURRENT_MINOR).$(shell echo $$(($(CURRENT_BUILD) + 1))) +patch-release: release + +minor-release: VERSION = $(CURRENT_MAJOR).$(shell echo $$(($(CURRENT_MINOR) + 1))).0 +minor-release: release + +major-release: VERSION = $(shell echo $$(($(CURRENT_MAJOR) + 1))).0.0 +major-release: release + +dev-release: + gh workflow run publish-dev.yml + @echo "Dev release workflow triggered." \ No newline at end of file diff --git a/README.md b/README.md index b610cd86..5ec88ee2 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,25 @@ pip install databao For more details about commands, supported data sources, and configuration options, visit the [docs](https://docs.databao.app). +## Releasing + +```bash +# Tag and push a specific version (CI publishes to PyPI) +make release VERSION=0.3.0 + +# Bump the patch version automatically (e.g. 0.3.0 -> 0.3.1) +make patch-release + +# Bump the minor version automatically (e.g. 0.3.1 -> 0.4.0) +make minor-release + +# Bump the major version automatically (e.g. 0.4.0 -> 1.0.0) +make major-release + +# Trigger a dev release via GitHub Actions +make dev-release +``` + ## Contributing We love contributions! Here’s how you can help: