Create pypi-publish.yaml #1
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
on: push | ||
jobs: | ||
publish-to-pypi: | ||
Check failure on line 3 in .github/workflows/pypi-publish.yaml GitHub Actions / .github/workflows/pypi-publish.yamlInvalid workflow file
|
||
name: "Publish Python 🐍 distribution 📦 to PyPI" | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: pybuild | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |