Registry Mirror
Skip to content

Conversation

@shimat

@shimat shimat commented Jul 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add .github/workflows/deploy-pages.yml: publishes BlazorApp in Release and deploys to GitHub Pages (enabled at https://shimat.github.io/opencvsharp_blazor_sample/) on every push to main, or manually via workflow_dispatch.
  • dotnet publish -c Release was blocked by two separate wasm-tools workload bugs, reproduced across net8.0 and net10.0 regardless of SDK feature band:
    • wasm-opt version mismatch (Please update Binaryen in emsdk dotnet/runtime#114723): the bundled wasm-opt (v117) predates binaryen PR #7106 (bulk-memory-opt / call-indirect-overlong, landed by v121). The workflow works around this by downloading and swapping in binaryen version_130's wasm-opt before publishing (checksum-verified). Once wasm-opt is new enough, a second, SDK-driven wasm-opt pass also needed its own flag set aligned with what emcc's internal pass already enables — added via a WasmOptConfigurationFlags item in BlazorApp.csproj (harmless for Debug builds, which don't invoke this pass).
    • mono-aot-cross crash: AOT-compiling OpenCvSharp.dll crashes the AOT compiler with a native GC assertion (sgen-alloc.c:409), on both net8.0 and net10.0. No workaround found yet, so RunAOTCompilation now defaults to false for Release (was true, which made every Release build/publish crash) — pass -p:RunAOTCompilation=true to retry once this is fixed upstream.
  • Fix wwwroot/index.html referencing /js/canvas.js as a root-absolute path, which 404s once served from a GitHub Pages project subpath (/opencvsharp_blazor_sample/...) instead of the domain root.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added automated deployment of the Blazor app to GitHub Pages.
    • Enabled manual and main-branch deployment options.
    • Added SPA fallback support for reliable navigation on hosted pages.
  • Bug Fixes

    • Improved compatibility with GitHub Pages subpaths by using relative script loading.
    • Updated release build settings to avoid a WebAssembly compilation issue.

shima and others added 4 commits July 11, 2026 21:18
Release publish was blocked by two wasm-tools workload bugs (see
dotnet/runtime#114723): an outdated bundled wasm-opt missing
bulk-memory-opt/call-indirect-overlong support, and a mono-aot-cross crash
when AOT-compiling OpenCvSharp.dll. The workflow works around the wasm-opt
issue by swapping in a newer binaryen build before publishing; RunAOTCompilation
now defaults to false for Release until the AOT crash is fixed upstream.

Also fixes wwwroot/index.html referencing /js/canvas.js as a root-absolute
path, which 404s once the app is served from a GitHub Pages subpath.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Will drop the extra branch before merging.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Build+publish succeeded on this branch (run 29152731162); deploy only
failed due to the github-pages environment's main-only protection rule,
which is expected and will pass once merged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@shimat, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43f19875-d3d2-4fa3-9b24-83b027842985

📥 Commits

Reviewing files that changed from the base of the PR and between 75645ba and 2391c43.

📒 Files selected for processing (1)
  • .github/workflows/deploy-pages.yml
📝 Walkthrough

Walkthrough

Adds a GitHub Pages workflow for building and deploying the Blazor app, updates WebAssembly compilation settings and optimization flags, and changes the canvas script reference to work from a repository subpath.

Changes

GitHub Pages deployment

Layer / File(s) Summary
WebAssembly build configuration
.BlazorApp/BlazorApp.csproj
Release builds disable AOT compilation for OpenCvSharp.dll, and native wasm builds receive additional wasm-opt feature flags.
Pages build pipeline
.github/workflows/deploy-pages.yml
The workflow installs .NET and wasm tools, patches wasm-opt, publishes the app, configures the Pages base path, adds SPA fallback files, and uploads the artifact.
Deployment and hosted asset paths
.github/workflows/deploy-pages.yml, BlazorApp/wwwroot/index.html
A dependent deployment job publishes the Pages artifact, while canvas.js uses a relative URL.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant DotnetPublish
  participant BinaryenWasmOpt
  participant PagesArtifact
  participant GitHubPages
  GitHubActions->>DotnetPublish: install wasm-tools and publish BlazorApp
  GitHubActions->>BinaryenWasmOpt: download and verify pinned wasm-opt
  BinaryenWasmOpt-->>DotnetPublish: replace bundled wasm-opt
  DotnetPublish->>PagesArtifact: upload published wwwroot
  GitHubActions->>GitHubPages: deploy uploaded artifact
Loading

Poem

A rabbit hops where Pages gleam,
With wasm flags to shape the stream.
The canvas finds its path just right,
While artifacts take graceful flight.
“Deploy!” I twitch my nose—what a sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary change: adding a GitHub Pages deployment workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deploy/github-pages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy-pages.yml:
- Around line 8-11: Move pages: write and id-token: write from the
workflow-level permissions block into the deploy job’s permissions, while
retaining contents: read at the workflow level if needed by build and deploy.
Ensure the build job does not inherit Pages write or OIDC token permissions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2c659da3-55e4-4da4-bdd8-7b3234de0d5e

📥 Commits

Reviewing files that changed from the base of the PR and between d6d10a9 and 75645ba.

📒 Files selected for processing (3)
  • .github/workflows/deploy-pages.yml
  • BlazorApp/BlazorApp.csproj
  • BlazorApp/wwwroot/index.html

Comment thread .github/workflows/deploy-pages.yml Resolved
Addresses CodeRabbit/zizmor finding: the build job (checkout, publish,
upload-artifact) never needs Pages write or OIDC token access, so grant
those only where actions/deploy-pages actually uses them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@shimat shimat self-assigned this Jul 11, 2026
@shimat
shimat merged commit 028beb1 into main Jul 11, 2026
1 check passed
@shimat
shimat deleted the deploy/github-pages branch July 11, 2026 15:50
shimat added a commit that referenced this pull request Jul 12, 2026
Add GitHub Pages deploy workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant