Publish to PyPI #10
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 to PyPI | |
| on: | |
| push: | |
| tags: ['v*'] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set version from tag and sync lockfile | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/v}" | |
| echo "Setting version to $TAG" | |
| sed -i "s/^version = .*/version = \"$TAG\"/" pyproject.toml | |
| uv lock | |
| - name: Build viewer frontend | |
| run: | | |
| cd frontend | |
| npm ci | |
| npm run build:viewer | |
| - name: Build Python distribution | |
| run: | | |
| python -m pip install --upgrade pip build | |
| python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |