Build Release and Publish on PyPI #13
This file contains hidden or 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
| name: Build Release and Publish on PyPI | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.9" | |
| - name: build release distributions | |
| run: | | |
| # NOTE: put your own distribution build steps here. | |
| python -m pip install build | |
| python -m build | |
| - name: upload dists | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| pypi-publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| needs: | |
| - release-build | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish release distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc |