Development #77
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: CI & Publish (PyPI + Release) | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write # For creating the release | |
| id-token: write # Required for PyPI Trusted Publisher | |
| actions: read | |
| jobs: | |
| dev: | |
| name: Development Checks | |
| uses: ./.github/workflows/develop.yml | |
| secrets: inherit | |
| publish: | |
| needs: dev | |
| name: Publish to PyPI & Create GitHub Release | |
| runs-on: ubuntu-latest | |
| # Runs only if on a version tag (e.g., refs/tags/1.2.3) | |
| # Runs only when code is pushed to main (not on PRs) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout (full history for changelog/tools) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up UV (publish runtime) | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Sync dev dependencies | |
| run: uv sync --locked --all-extras --dev --no-progress -q | |
| - name: Build sdist & wheel with uv | |
| run: uv build | |
| # Publication via OIDC (Trusted Publisher) – no secret required on GitHub side | |
| - name: Publish to PyPI | |
| run: uv publish --verbose | |
| # GitHub Release with auto notes + attached artifacts (sdist/wheel) | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| dist/*.whl | |
| dist/*.tar.gz | |
| docs: | |
| name: Deploy MkDocs | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install dependencies | |
| run: uv sync --locked --all-extras --dev --no-progress -q | |
| - name: Deploy MkDocs | |
| run: uv run mkdocs gh-deploy --force |