v0.2.2 #3
Workflow file for this run
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: Publish | |
| on: | |
| workflow_dispatch: # Allows manual trigger | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| name: "Build distribution" | |
| runs-on: '${{ matrix.os }}' | |
| strategy: | |
| matrix: | |
| # TODO: Comment in additional platforms if using C extensions / platform-specific wheels | |
| os: | |
| - ubuntu-latest | |
| # - macos-latest | |
| python-version: | |
| # - "3.10" | |
| # - "3.11" | |
| # - "3.12" | |
| - "3.13" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| # make sure tags are fetched so we can get a version | |
| - name: Fetch Tags | |
| run: | | |
| git fetch --prune --unshallow --tags | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Restore UV environment | |
| run: cp production.uv.lock uv.lock | |
| - name: Build Package | |
| run: | | |
| uv build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish: | |
| name: "Publish distribution" | |
| if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/tesseract-jax | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |