From f15b568e95cdd2e13ad450d3f197404cc1154dc9 Mon Sep 17 00:00:00 2001 From: Kolawole Mangabo Date: Wed, 22 Jul 2026 01:36:49 +0100 Subject: [PATCH] add release tooling: bump2version config and PyPI publish workflow Adds bump2version as a dev dependency to keep pyproject.toml and __init__.py version strings in sync, and a GitHub Actions workflow that publishes to PyPI when a GitHub Release is published. Co-Authored-By: Claude Sonnet 5 --- .bumpversion.cfg | 14 ++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++++++ pyproject.toml | 1 + uv.lock | 11 +++++++++++ 4 files changed, 47 insertions(+) create mode 100644 .bumpversion.cfg create mode 100644 .github/workflows/release.yml diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..6bbc4c0 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,14 @@ +[bumpversion] +current_version = 0.1.0 +commit = True +tag = True +tag_name = v{new_version} +message = release: bump version {current_version} -> {new_version} + +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" + +[bumpversion:file:src/reconify/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..485e693 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Release + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: python -m pip install --upgrade pip build + - run: python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 516eabe..f1d6dbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "build>=1.2", + "bump2version>=1.0", "mypy>=1.10", "pytest>=8", "pytest-asyncio>=0.23", diff --git a/uv.lock b/uv.lock index 082e2ec..067cd0b 100644 --- a/uv.lock +++ b/uv.lock @@ -95,6 +95,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0d/fe/6bea5c9162869c5beba5d9c8abbed835ec85bf1ec1fba05a3822325c45f3/build-1.5.0-py3-none-any.whl", hash = "sha256:13f3eecb844759ab66efec90ca17639bbf14dc06cb2fdf37a9010322d9c50a6f", size = 26018, upload-time = "2026-04-30T03:18:23.644Z" }, ] +[[package]] +name = "bump2version" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/2a/688aca6eeebfe8941235be53f4da780c6edee05dbbea5d7abaa3aab6fad2/bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6", size = 36236, upload-time = "2020-10-07T18:38:40.119Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/e3/fa60c47d7c344533142eb3af0b73234ef8ea3fb2da742ab976b947e717df/bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410", size = 22030, upload-time = "2020-10-07T18:38:38.148Z" }, +] + [[package]] name = "certifi" version = "2026.6.17" @@ -568,6 +577,7 @@ dependencies = [ [package.optional-dependencies] dev = [ { name = "build" }, + { name = "bump2version" }, { name = "mypy" }, { name = "pytest" }, { name = "pytest-asyncio" }, @@ -577,6 +587,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "build", marker = "extra == 'dev'", specifier = ">=1.2" }, + { name = "bump2version", marker = "extra == 'dev'", specifier = ">=1.0" }, { name = "httpx", specifier = ">=0.27,<1" }, { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.10" }, { name = "pydantic", specifier = ">=2.7,<3" },