name: Build and upload to PyPI on: release: types: - published jobs: build: name: Build sdist and wheel runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build sdist and wheel run: pipx run build - uses: actions/upload-artifact@v4 with: name: cibw-dist path: dist/* upload_pypi: needs: [build] runs-on: ubuntu-latest environment: pypi 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