Add permissions on release creation #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The cibuildwheel action triggers on creation of a release, this | |
# triggers on publication. | |
# The expected workflow is to create a draft release and let the wheels | |
# upload, and then hit 'publish', which uploads to PyPi. | |
on: | |
release: | |
types: | |
- published | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/cymem | |
permissions: | |
id-token: write | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
# unpacks all CIBW artifacts into dist/ | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 |