From 11178c38965fb1c2d05645ad1cd26cae10c614c5 Mon Sep 17 00:00:00 2001 From: Alisson Leal Date: Tue, 29 Sep 2026 00:24:49 -0300 Subject: [PATCH] fix(ci): publish to PyPI with trusted publishing rye publish needs an API token and cannot exchange the GitHub OIDC token. Build with rye and upload with pypa/gh-action-pypi-publish instead. --- .github/workflows/publish-pypi.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 59107ca..f25f67f 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -27,6 +27,11 @@ jobs: RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - - name: Publish to PyPI + # `rye publish` cannot use trusted publishing (OIDC), so build with rye + # and upload with the PyPA action, which exchanges the OIDC token. + - name: Build run: | - bash ./bin/publish-pypi + rye build --clean + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2