From 4719acdf2ec08542fba6b2cc792862b73385707f Mon Sep 17 00:00:00 2001 From: Kishan Mehta Date: Fri, 23 Oct 2026 13:56:18 +0530 Subject: [PATCH 1/2] Use PyPI trusted publishing with a separate build job Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/publish.yml | 52 +++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f8ead03..155794a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,28 +1,50 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - name: publish +permissions: + contents: read + on: push: tags: - "[0-9]+.[0-9]+.[0-9]+" jobs: - deploy: + build: + name: Build distribution runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - python-version: '3.13' - - name: Install dependencies - run: | - pip install --upgrade build twine - python -m build - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.13.0 + python-version: "3.14" + - name: Install pypa/build + run: python3 -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: python-package-distributions + path: dist/ + + publish: + name: Publish to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/html-text + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - password: ${{ secrets.PYPI_TOKEN }} + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 From ae07d4b95ca1b5dfbb47159112d32864ca91339a Mon Sep 17 00:00:00 2001 From: Kishan Mehta Date: Fri, 23 Oct 2026 14:05:06 +0530 Subject: [PATCH 2/2] Bump twine and build in twinecheck twine 6.2.0 rejects the metadata version 2.5 that current hatchling emits. Co-Authored-By: Claude Sonnet 5.5 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d8474ff..21ce1f9 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ setenv = [testenv:twinecheck] basepython = python3 deps = - twine==6.2.0 - build==1.3.0 + twine==7.0.0 + build==1.5.0 commands = python -m build --sdist twine check dist/*