ci: publish TypeDoc to packages.electronjs.org on version tags - #4385
Draft
claude[bot] wants to merge 1 commit into
Draft
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Add a docs.yml workflow, modelled on @electron/packager's, that builds `yarn docs` on every `v*` tag and uploads `api-docs/` to packages.electronjs.org/forge/<tag>/ via Azure OIDC (environment `docs-publish`). Also set the TypeDoc site name to "Electron Forge" and add the missing external symbol link for `@electron/packager` `Options.electronVersion`, so `yarn docs` now builds with 0 errors and 0 warnings. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P4HRbe7XtfgT6eVQZbjcUb
5 tasks
This branch has not been deployed
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.
Requested by Erick Zhao · Slack thread
yarn docsbuilds with 0 errors / 0 warnings locally;oxfmt --checkandzizmorare clean on the new workflow.)Summarize your changes:
Before: The TypeDoc API reference is only published to js.electronforge.io, via
gh-pages.ymlcommittingapi-docs/to thegh-pagesbranch, and only onv7.**tags. The v8 alpha tags (v8.0.0-alpha.N) never publish anything, and Forge has no presence on packages.electronjs.org even though the rest of the@electron/*toolchain (packager, get, asar, rebuild, osx-sign, notarize, ...) publishes there andtypedoc.jsoncalready cross-links to those pages.After: Every version tag (
v[0-9]+.[0-9]+.[0-9]+*, so prereleases included) runs a newdocs.ymlworkflow that buildsyarn docsand uploadsapi-docs/topackages.electronjs.org/forge/<tag>/over Azure OIDC, exactly the way@electron/packagerand the other@electron/*packages do it. The site title is now "Electron Forge" (was the TypeDoc default "Documentation"), and the one remainingyarn docswarning is fixed by adding the@electron/packagerOptions.electronVersionentry toexternalSymbolLinkMappings, so the docs build is now 0 errors / 0 warnings.How:
.github/workflows/docs.ymlis a near-verbatim copy ofelectron/packager'sdocs.yml: workflow-levelid-token: write+contents: read, jobenvironment: docs-publish, theactions/checkout/actions/setup-nodeSHAs Forge already pins elsewhere (withpersist-credentials: false,node-version-file: .nvmrc, andpackage-manager-cache: falseso a publishing job never restores a cache),yarn install --immutable,yarn docs, thenazure/login+azure/cliat the same SHAs packager uses. Differences from packager: the upload script reads the storage account and tag fromenv:instead of inline${{ }}(keeps zizmor's template-injection audit clean without an ignore comment), and theforgepath segment is hardcoded rather than derived fromgithub.event.repository.name.gh-pages.ymlis intentionally left untouched (see open questions).Depends on (electron/infra#349):
"forge"toallowed_reposinterraform/global/oidc/ecosystem-packages-upload.tf. That module provisions thedocs-publishenvironment with itsv*tag-only deployment policy, the Azure federated credential forrepo:electron/forge:environment:docs-publish, and scopes theAZURE_OIDC_CLIENT_ID/AZURE_OIDC_TENANT_ID/AZURE_OIDC_SUBSCRIPTION_ID/AZURE_ECOSYSTEM_PACKAGES_STORAGE_ACCOUNT_NAMEorg secrets to this repo. Until that lands, the workflow will fail at the environment / Azure login step (deep-link uploads need nothing else).packages-redirectorCloudflare Worker so/forge/and/forge/latestresolve the latest version from@electron-forge/coreon npm. Today it falls back tohttps://registry.npmjs.org/@electron/<name>/latest, and@electron/forgedoes not exist, sohttps://packages.electronjs.org/forge/currently 302s to/forge/vnull/index.html.Open questions:
gh-pages.yml/ js.electronforge.io in favour of a redirect topackages.electronjs.org/forge/? This PR leaves the existing v7 publish in place so nothing regresses while we decide. Note the new TypeDoc slugs are_electron-forge_*(hyphen) while the old js.electronforge.io URLs used_electron_forge_*, so any redirect would need to account for that, and the ~45 API links indocs/should be repointed as a follow-up.release.ymlcreates thevXtag viagh release createwith a secret-service App token. We need to confirm that token belongs to the same App the ruleset allows, otherwise tag creation from the release workflow will be blocked onceforgeis added toallowed_repos.🤖 Generated with Claude Code
https://claude.ai/code/session_01P4HRbe7XtfgT6eVQZbjcUb
Generated by Claude Code