Repository navigation
ci(docs): publish versioned docs from release/* branches with mike (main) - #192
Merged
Merged
Conversation
Replace the single-version deploy-pages workflow with mike deploys to a gh-pages branch so the 2.x product line and the 3.x pre-release line can share https://swgoh-utils.github.io/comlink-python/ behind Material's version picker. This is the 2.x half; the 3.x line carries the same docs.yml and overrides, with `extra.prerelease: true` in mkdocs.yml. - docs.yml: deploy on main and release/v* (plus manual runs on v* tags); the version comes from CHANGELOG.md like release.yml: main -> X.Y + `latest`, pre-release lines -> X.Y + `dev` titled "(pre-release)"; stable release/vX.Y.Z staging branches are skipped. The first stable deploy runs `mike set-default latest` so the root keeps opening 2.x. fetch-depth 0, bot git identity, contents: write, one gh-pages concurrency group, and a guard so forks never publish. - mkdocs.yml: extra.version.provider mike, default alias `latest`. - overrides/main.html: "older version" banner (pre-release banner when a line sets extra.prerelease). - docs dependency group: add mike. - ci.yml: build-check docs with --strict, matching the deploy. - CONTRIBUTING: "Publishing the docs" with the one-time cutover steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v1 -> v2 migration guide and README told readers to replace `except requests.RequestException` with `except httpx.RequestError`, but the clients catch httpx.RequestError and re-raise SwgohComlinkException, so that handler never fires. Point readers at SwgohComlinkException and list the SwgohComlinkHTTPError family (v2.3+) in the hierarchy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per review: docs deploy from branches named release/*, each published under its own version; latest/default follows the newest stable release and pre-releases get an alias for their kind. - docs.yml: trigger on pushes to release/** (same path filters, plus the new helper) and workflow_dispatch; the job runs only in swgoh-utils/comlink-python on refs/heads/release/*. main, develop and tags no longer deploy. - .github/scripts/docs_version.py: version = PEP 440 version in the branch name (release/v2.5.0 -> 2.5.0); invalid or local versions fail with ::error::. Reads `mike list --json`: a stable version takes `latest` (and set-default) only if >= every deployed stable; a pre-release takes alpha/beta/rc/dev (dev wins) only if >= every deployed version of its kind, and never touches latest. Unit tests in tests/unit/test_docs_version.py. - mkdocs.yml: extra.prerelease reads DOCS_PRERELEASE (set from the decision), defaulting to the line's own value for local builds; check-yaml skips mkdocs.yml (the strict docs build validates it). - setup-uv cache disabled in the publishing job (zizmor cache-poisoning). - .gitignore: un-ignore .github/scripts/ (a bare `scripts/` rule hid it). - CONTRIBUTING: version/alias rules, release timing (prepare-release.yml pushes with GITHUB_TOKEN, which does not start workflows, so run the deploy by hand), and the cutover steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks #191 (versioned docs with mike) onto
main. This replaces the old single-version Pages workflow, which no longer matches how the site is published.The versioned site is already live:
release/v2.5.0(mainplus these same 3 commits) deployed2.5.0aslatest, and Pages now serves thegh-pagesbranch.mainstill has the olddocs.yml, which deploys throughactions/deploy-pageson pushes that touch docs paths. Pages no longer deploys from GitHub Actions, so that job would fail. After this merge,mainno longer deploys docs at all; onlyrelease/*branches do.The commits are the same as #191's, with one conflict resolved in
CONTRIBUTING.md's repo file tree:mainkeeps its "npm-based" description forcommitlint.yml, and the line fordocs.ymluses the new description. The next back-merge todevelopmay need that one line resolved, keepingdevelop's version.Test plan
uv lock --checkpasses on this branch (based onmain)uv run pytest tests/unit/test_docs_version.py: 26 passeduv run --group docs mkdocs build --strictpasses.github/workflows/docs.yml,.github/scripts/docs_version.pyandoverrides/main.htmlare byte-identical todeveloprelease/v2.5.0, deployed successfully (run 39130818128), and https://swgoh-utils.github.io/comlink-python/ now redirects tolatest/= 2.5.0🤖 Generated with Claude Code