Skip to content

ci(docs): publish versioned docs from release/* branches with mike (main) - #192

Merged
MarTrepodi merged 3 commits into
mainfrom
docs/versioned-pages-main
Oct 18, 2026
Merged

MarTrepodi merged 3 commits into
mainfrom
docs/versioned-pages-main

Conversation

@MarTrepodi

Copy link
Copy Markdown
Collaborator

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 (main plus these same 3 commits) deployed 2.5.0 as latest, and Pages now serves the gh-pages branch. main still has the old docs.yml, which deploys through actions/deploy-pages on pushes that touch docs paths. Pages no longer deploys from GitHub Actions, so that job would fail. After this merge, main no longer deploys docs at all; only release/* branches do.

The commits are the same as #191's, with one conflict resolved in CONTRIBUTING.md's repo file tree: main keeps its "npm-based" description for commitlint.yml, and the line for docs.yml uses the new description. The next back-merge to develop may need that one line resolved, keeping develop's version.

Test plan

  • uv lock --check passes on this branch (based on main)
  • uv run pytest tests/unit/test_docs_version.py: 26 passed
  • uv run --group docs mkdocs build --strict passes
  • .github/workflows/docs.yml, .github/scripts/docs_version.py and overrides/main.html are byte-identical to develop
  • The same tree, pushed as release/v2.5.0, deployed successfully (run 39130818128), and https://swgoh-utils.github.io/comlink-python/ now redirects to latest/ = 2.5.0
  • Required checks pass on this PR

🤖 Generated with Claude Code

MarTrepodi and others added 3 commits October 17, 2026 18:58
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>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Changes related to continuous integration processes dependencies Updates to package dependency libraries testing labels Oct 18, 2026
@MarTrepodi
MarTrepodi merged commit 30259a6 into main Oct 18, 2026
17 checks passed
@MarTrepodi
MarTrepodi deleted the docs/versioned-pages-main branch October 18, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes related to continuous integration processes dependencies Updates to package dependency libraries documentation Improvements or additions to documentation testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant