From 54ac6a39fedd7f625a57d6618069d69759da0004 Mon Sep 17 00:00:00 2001 From: Luis Sanchez Date: Thu, 27 Aug 2026 15:42:07 -0500 Subject: [PATCH] ci: use official PyPI publishing action --- .github/workflows/cd.yml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ddfbc07..a0abe41 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -32,22 +32,5 @@ jobs: python3 -m build python3 -m twine check dist/* - - name: Publish to PyPI - env: - PYPI_OIDC_AUDIENCE: pypi - run: | - set -euo pipefail - - oidc_response=$(curl --fail-with-body --silent --show-error \ - -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \ - "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=${PYPI_OIDC_AUDIENCE}") - oidc_token=$(jq --raw-output '.value' <<< "${oidc_response}") - - token_response=$(curl --fail-with-body --silent --show-error \ - -X POST https://pypi.org/_/oidc/mint-token \ - -H 'Content-Type: application/json' \ - --data "$(jq --null-input --arg token "${oidc_token}" '{token: $token}')") - api_token=$(jq --raw-output '.token' <<< "${token_response}") - - echo "::add-mask::${api_token}" - TWINE_USERNAME=__token__ TWINE_PASSWORD="${api_token}" python3 -m twine upload dist/* + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1