Improve token handling (#4653)

* Use release environment

* Use pypi trusted publishing

* typo
This commit is contained in:
konstin 2023-05-26 09:52:24 +02:00 committed by GitHub
parent 33a7ed058f
commit 12e45498e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -394,18 +394,22 @@ jobs:
- musllinux - musllinux
- musllinux-cross - musllinux-cross
if: "startsWith(github.ref, 'refs/tags/')" if: "startsWith(github.ref, 'refs/tags/')"
environment:
name: release
permissions:
# For pypi trusted publishing
id-token: write
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: wheels name: wheels
- uses: actions/setup-python@v4 path: wheels
- name: "Publish to PyPi" - name: "Publish to PyPi"
env: uses: pypa/gh-action-pypi-publish@release/v1
TWINE_USERNAME: __token__ with:
TWINE_PASSWORD: ${{ secrets.RUFF_TOKEN }} skip-existing: true
run: | packages-dir: wheels
pip install --upgrade twine verbose: true
twine upload --skip-existing *
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: binaries name: binaries