[CI] Run API-docs stub regeneration on Linux via Mono#144
Closed
mattleibow wants to merge 1 commit into
Closed
Conversation
The `regenerate-stubs` job in auto-api-docs-writer ran on `windows-latest`
solely because mdoc.exe is a .NET Framework tool. That was the last
non-Linux job across the SkiaSharp + SkiaSharp-API-docs pipeline, leaving
this one workflow on a different OS than everything else that builds the
docs — different paths, different toolchain, harder to reproduce locally.
mdoc.exe runs fine under Mono, and SkiaSharp's docs.cake already invokes it
through `mono`, so the job does not actually need Windows. The managed GTK#
reference assemblies mdoc needs are supplied from NuGet by the cake comparer
(passed to mdoc as `--lib` paths), so no system GTK# install is required —
Mono is the only extra dependency.
Changes:
- regenerate-stubs: windows-latest -> ubuntu-latest
- install mono-complete (apt) instead of the GTK# 2 MSI download/install
- drop the now-redundant `dotnet tool restore` and `docs-download-output`
steps; call the shared `scripts/infra/docs/generate-api-docs.sh` entry
point instead of `dotnet cake --target=update-docs`
- use global.json for the .NET SDK and Linux-style nuget cache paths
- recompiled the .lock.yml via `gh aw compile` (frontmatter hash updated)
This makes the entire two-repo doc-generation pipeline Linux-only, matching
the local Docker image and the SkiaSharp-side CI.
Note: depends on the companion SkiaSharp PR that adds
scripts/infra/docs/generate-api-docs.sh; that PR must merge first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Contributor
|
Learn Build status updates of commit 5bcb571: ✅ Validation status: passed
For more details, please refer to the build report. |
mattleibow
added a commit
that referenced
this pull request
Jun 23, 2026
[CI] Run API-docs stub regeneration on Linux via Mono (#147) Two related changes to the auto-api-docs-writer workflow: flip the regenerate-stubs job to Linux, and stop the writer from running on pull requests. ~~ Move regenerate-stubs from Windows to Linux ~~ This job was the last non-Linux job across the SkiaSharp + SkiaSharp-API-docs doc pipeline; with it flipped, the entire two-repo pipeline runs on Linux, matching the local Docker image and the SkiaSharp-side CI. The job only used Windows because mdoc.exe is a .NET Framework tool, but that requirement no longer holds: * mdoc.exe runs fine under Mono, and SkiaSharp's docs.cake already invokes it via `mono`. * The managed GTK# reference assemblies mdoc needs come from NuGet via the cake comparer (passed as --lib paths), so no system GTK# install is required — the Windows GTK# 2 MSI download/install was redundant. So Mono (mono-complete via apt) is the only added dependency. The job now calls the shared scripts/infra/docs/generate-api-docs.sh entry point instead of `dotnet cake --target=update-docs`, uses global.json for the SDK and Linux-style nuget cache paths, and drops the now-redundant `dotnet tool restore` and docs-download-output steps. Proven locally end-to-end on Linux (Docker, dotnet10 + mono-complete) against this repo's stub tree: it correctly pruned the orphaned net6-only type files (ActionHelper, FloatFloatActionHelper) and added the newer [Nullable] attributes, and two consecutive runs produced byte-identical output (hash ec15190a) — so the job is both correct and idempotent on Linux. Prerequisite: the companion mono/SkiaSharp#4200, which adds scripts/infra/docs/generate-api-docs.sh, has merged to main, so the checked-out SkiaSharp tree now has the script. ~~ Drop the pull_request trigger ~~ The writer is a full agentic workflow: it regenerates stubs, fills placeholders with AI, and opens a PR via gh-aw safe-outputs. When a PR edits this workflow, the writer fires on that PR and then fails, because safe-outputs refuses to create a PR that touches protected workflow files (protect_top_level_dot_folders: true) — surfacing as a red safe_outputs check on this very PR. Removing the pull_request trigger stops the writer running on PRs; push:[main] still validates workflow edits after they land, and workflow_dispatch + schedule are unaffected. Recompiled .lock.yml via `gh aw compile` for both commits. Supersedes #144, which gh-aw's recreate_ref:true auto-closed when a run was dispatched on its branch; moved to the dedicated ci/linux-mdoc-regenerate-stubs branch so the agentic placeholder-fill PRs reusing dev/linux-mdoc-regenerate-stubs (e.g. #145) can't collide with it. Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What
Flip the
regenerate-stubsjob inauto-api-docs-writerfromwindows-latesttoubuntu-latest, running mdoc.exe under Mono.This was the last non-Linux job across the SkiaSharp + SkiaSharp-API-docs doc pipeline. With this change the entire two-repo pipeline runs on Linux, matching the local Docker image and the SkiaSharp-side CI.
Why Windows was no longer needed
The job only used Windows because mdoc.exe is a .NET Framework tool. But:
docs.cakealready invokes it viamono.--libpaths), so no system GTK# install is required. The Windows GTK# 2 MSI download/install was redundant.So Mono is the only extra dependency.
Changes
regenerate-stubs:windows-latest→ubuntu-latestmono-complete(apt) instead of the GTK# 2 MSI download/installdotnet tool restoreanddocs-download-outputstepsscripts/infra/docs/generate-api-docs.shentry point instead ofdotnet cake --target=update-docsglobal.jsonfor the .NET SDK and Linux-style nuget cache paths.lock.ymlviagh aw compileMerge order
scripts/infra/docs/generate-api-docs.sh(the Linux-everywhere doc-generation infra). That PR must merge first, otherwise the checked-out SkiaSharp tree won't have the script.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com