Merge pull request #25 from jessegrabowski/linear-kernel #53
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: PyPI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Build the sdist and the wheel | |
| run: | | |
| pip install build | |
| python3 -m build | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: artifact | |
| path: dist/* | |
| publish: | |
| name: upload release to PyPI | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'bwengals' && github.event_name == 'release' && github.event.action == 'published' | |
| # Use the `release` GitHub environment to protect the Trusted Publishing (OIDC) | |
| # workflow by requiring signoff from a maintainer. | |
| environment: release | |
| permissions: | |
| # write id-token is necessary for trusted publishing (OIDC) | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: artifact | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 |