Repository navigation
ci(docs): publish versioned docs from release/* branches with mike - #191
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>
MarTrepodi
marked this pull request as ready for review
October 17, 2026 22:53
This was referenced Oct 18, 2026
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.
Description
Publishes the docs site as versioned docs with mike, so the stable 2.x line and the upcoming 3.x pre-releases can be published side by side at https://swgoh-utils.github.io/comlink-python/ behind Material's version picker.
Docs now deploy from
release/*branches, and each branch publishes its own version:release/v2.5.0(highest stable deployed)2.5.0latest(site default)2.5.0release/v2.4.2(after 2.5.0 is deployed)2.4.22.4.2release/v3.0.0a23.0.0a2alpha3.0.0a2 (alpha)release/v3.0.0rc13.0.0rc1rc3.0.0rc1 (rc)release/v3.0.0a2.dev13.0.0a2.dev1dev3.0.0a2.dev1 (dev)release/next::error::(not a PEP 440 version)latestand the root URL follow the highest stable version already deployed, not the most recent push. A later patch to an older line therefore doesn't takelatest.alpha/beta/rc/dev) only when it is the highest deployed version of that kind, and it never changeslatest.Changes
.github/workflows/docs.yml:mainwithmike deploy --push --update-aliasesto agh-pagesbranch.release/**(same path filters) and onworkflow_dispatch.github.repository == 'swgoh-utils/comlink-python'and the ref isrefs/heads/release/*, so forks and other refs never publish.main,developand tags no longer deploy.contents: write, agh-pagesconcurrency group,fetch-depth: 0, a strict build before deploying, and no setup-uv cache in the publishing job..github/scripts/docs_version.py: a new helper that turns the branch name andmike list --jsonintoversion/alias/title/set_default/prerelease, usingpackaging.version.Version. It is covered bytests/unit/test_docs_version.py.mkdocs.yml+overrides/main.html:extra.version.provider: mikeadds the version picker.DOCS_PRERELEASE.latest.pyproject.toml/uv.lock: addsmike>=2.2.0to thedocsdependency group.ci.yml: the requiredDocscheck now builds with--strict, matching the deploy job..gitignore/.pre-commit-config.yaml:.github/scripts/; a barescripts/rule was hiding it.check-yamlskipsmkdocs.yml, whose!ENVtag the safe loader rejects; the strict docs build validates it instead.README.md,docs/migration.md): these told readers to catchhttpx.RequestError, but the clients re-raise it asSwgohComlinkException, so that handler never fires. They now point atSwgohComlinkExceptionand theSwgohComlinkHTTPErrorfamily.CONTRIBUTING.md: adds a "Publishing the docs" section covering the version and alias rules, release timing, and the one-time cutover.Related Issues
None. This prepares for folding the 2.5.x product line and the experimental 3.x line into this repository.
Type of Change
Breaking Changes
There's no change to the library. The published docs URLs change once the cutover below is done:
/comlink-python/2.5.0/<page>/.latest.Checklist
developbranch (only release PRs targetmain)feat:,fix:,refactor:, etc.) — they become the changelogCHANGELOG.mdby hand (it is generated from commit messages)README.md,docs/,examples/) if user-facing behavior changeduv run pytest tests/): to be confirmed by CIuv run ruff check src/ tests/anduv run ruff format --check src/ tests/): to be confirmed by CIuv run ty check src/swgoh_comlink/): to be confirmed by CITesting
docs_version.py: 26 unit tests, plus direct runs on sample branches; the table above shows the actual output.--push) into a throwawaygh-pages, deploying2.5.0, then3.0.0a2, then2.4.2:latestand the root redirect stayed on 2.5.0, andalphapointed at 3.0.0a2.docs.yml: checked with actionlint, andmkdocs build --strictpasses.Reviewers, please verify:
docs_version.py;docs.yml;Cutover after merge (maintainer, one time)
mainthrough the normal release flow, or a direct PR tomainas with docs(api): order client pages for first-time readers #190. Until then,mainkeeps deploying the single-version site through GitHub Actions.gh-pagesto deploy: addgh-pagesto thegithub-pagesenvironment's deployment branch policy. Today it allows onlymain, and branch-based Pages builds would be blocked.release/v2.5.0branch that has the released 2.5.0 docs plus this workflow, i.e.mainwith this PR merged in. The deploy createsgh-pageswith2.5.0,latest, and the root redirect. If the push doesn't change a watched path, run "Deploy docs" by hand on that branch.gh-pages/ (root)".2.5.0/andversions.jsonlists2.5.0withlatest.release/v3.0.0a2, with the v3 equivalent of this change, to publish3.0.0a2 (alpha).Release timing:
prepare-release.ymlpushesrelease/vX.Y.Zusing the workflow's built-in token, and GitHub doesn't start workflow runs from those pushes. So stable docs need a manual "Deploy docs" run on that branch. A follow-up could haveprepare-release.ymlcallgh workflow run docs.yml --ref release/vX.Y.Z;workflow_dispatchevents from that token do start runs.delete_branch_on_mergeremoves release branches after their PR merges, but the published versions stay ongh-pages.🤖 Generated with Claude Code