diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ead980e..5431a21e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,3 +38,28 @@ jobs: -m "not slow and not integration and not requires_tensorflow and not requires_fastattn" \ --tb=short \ -v + + publish: + name: Build and publish to PyPI + needs: test + runs-on: ubuntu-latest + if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') + + environment: + name: pypi + url: https://pypi.org/project/mussel-pathology/ + + permissions: + id-token: write # required for trusted publishing (OIDC) + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Build distribution + run: uv run --with build python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1