| 1 | name: Upload to PyPI |
| 2 | on: |
| 3 | push: |
| 4 | tags: |
| 5 | - "*" |
| 6 | |
| 7 | workflow_dispatch: |
| 8 | |
| 9 | jobs: |
| 10 | release-build: |
| 11 | runs-on: ubuntu-latest |
| 12 | |
| 13 | steps: |
| 14 | - uses: actions/[email protected] |
| 15 | |
| 16 | - uses: actions/[email protected] |
| 17 | with: |
| 18 | python-version: 3.x |
| 19 | |
| 20 | - run: pip install build twine |
| 21 | |
| 22 | - run: python -m build --wheel --sdist |
| 23 | |
| 24 | - uses: actions/[email protected] |
| 25 | with: |
| 26 | name: release-dists |
| 27 | path: dist/ |
| 28 | |
| 29 | release-publish: |
| 30 | runs-on: ubuntu-latest |
| 31 | needs: |
| 32 | - release-build |
| 33 | permissions: |
| 34 | id-token: write |
| 35 | |
| 36 | steps: |
| 37 | - uses: actions/[email protected] |
| 38 | with: |
| 39 | name: release-dists |
| 40 | path: dist/ |
| 41 | |
| 42 | - uses: pypa/[email protected] |
| 43 | with: |
| 44 | skip-existing: true |