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

View file

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