Build and Release to PyPI #2
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 and Release to PyPI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release: | |
| description: 'tag to create and push, of the form "X.Y.Z"' | |
| required: true | |
| type: string | |
| defaults: | |
| run: | |
| working-directory: python | |
| jobs: | |
| pypi-build-and-release: | |
| name: Build and Release to PyPI | |
| # Since we only make pure python wheels and source, | |
| # we only need to build on one platform. | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Needed for trusted publishing to PyPI | |
| id-token: write | |
| # Needed for pushing commit and tags | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: tag and push tags | |
| run: | | |
| git config user.name "NickCrews" | |
| git config user.email "nicholas.b.crews@gmail.com" | |
| git tag -a "v${{ inputs.release }}" -m "Release ${{ inputs.release }}" | |
| git push | |
| git push origin "v${{ inputs.release }}" | |
| - name: copy data files | |
| run: python cp.py | |
| - name: Build sdist and wheel | |
| run: uv build | |
| - name: Push build artifacts to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| packages-dir: python/dist |