From 7a2fd8c78be4c8cf0a2f4d12870bf01033fefaa1 Mon Sep 17 00:00:00 2001 From: Tim Case Date: Mon, 27 Apr 2026 19:22:29 -0500 Subject: [PATCH] Stop being a dumb human trying to publish this manually - Add gh publish action - Fix up the make build target - Bump VERSION - Closes #131 --- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++++++ Makefile | 4 ++-- VERSION | 2 +- pyproject.toml | 2 +- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e732a45 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + steps: + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-python@v6.2.0 + with: + python-version: "3.12" + - name: Build package + run: pip install build && python -m build + - name: Upload dist artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + needs: build + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - name: Download dist artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/Makefile b/Makefile index 40a4352..2a90cd3 100644 --- a/Makefile +++ b/Makefile @@ -94,11 +94,11 @@ viewcover: ci-unittests xdg-open htmlcov/index.html; \ fi -build: clean +build: clean virtualenv @echo "#############################################" @echo "# Building sdist + wheel" @echo "#############################################" - . $(NAME)env3/bin/activate && python -m build + . $(NAME)env3/bin/activate && pip install build && python -m build pypi: build @echo "#############################################" diff --git a/VERSION b/VERSION index 227cea2..38f77a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 diff --git a/pyproject.toml b/pyproject.toml index 88c1afc..012e7db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "bitmath" -version = "2.0.0" +version = "2.0.1" description = "Pythonic module for representing and manipulating file sizes with different prefix notations (file size unit conversion)" readme = "README.rst" requires-python = ">=3.9"