From c98420718ab269f47956456ce7b417566864b812 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 4 Nov 2025 15:26:59 +0200 Subject: [PATCH] Use trusted publishing --- .github/workflows/ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c80c43..80319a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,12 @@ jobs: # ... and all build jobs completed successfully needs: [build_wheels, build_aarch64_wheels] runs-on: ubuntu-latest + environment: + name: publish-to-pypi + url: https://pypi.org/p/unicodedata2 + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + contents: write # Needed to create GH release steps: - uses: actions/checkout@v4 with: @@ -127,11 +133,8 @@ jobs: body_path: "${{ runner.temp }}/release_notes.md" draft: false prerelease: false - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist - twine upload dist/* + - name: Build sdist + run: python setup.py sdist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1