ci(web): build wasm in the deploy pipeline instead of committing it (#156) #168

Merged
funman300 merged 1 commits from fix/156-wasm-in-ci into master 2026-07-09 21:57:57 +00:00
Owner

Fixes #156.

solitaire_server/web/pkg/ is removed from source control (~23 MB of binary artifacts per rebuild commit) and the web-wasm-rebuild commit-back workflow is deleted. The wasm is now built where it's consumed:

  • Deployment: a new wasm-builder stage in solitaire_server/Dockerfile runs build_wasm.sh with the same pinned toolchain the old workflow used (wasm-bindgen-cli 0.2.120, wasm-pack 0.14.0, binaryen 130 — release URLs verified); the runtime image copies pkg/ from that stage. The image build is the artifacts' single source of truth.
  • E2E: web-e2e builds the wasm before Playwright (play_canvas.spec drives the real canvas), and its trigger paths now include solitaire_web/solitaire_engine/solitaire_data/build_wasm.sh, which it silently missed before.
  • docker-build also triggers on solitaire_data/** and build_wasm.sh now, so every wasm-affecting master change redeploys without the intermediate bot commit.
  • scripts/watch_deploy.sh no longer waits on the deleted workflow; stale comments in test.yml, build_wasm.sh, and ARCHITECTURE.md updated.
  • Self-hosters serving /web or /play from a source checkout run ./build_wasm.sh once; pkg/ is gitignored.

Notes for review: the Dockerfile stage mirrors the old workflow's proven build (same script, same pins), but the first docker-build run on master is the real proving ground — the image build gets ~15-25 min slower on wasm-affecting changes (no more free ride on the committed artifacts), amortized by the buildx registry cache for server-only changes.

cargo test --workspace and cargo clippy --workspace -- -D warnings are clean (no Rust changes).

🤖 Generated with Claude Code

Fixes #156. `solitaire_server/web/pkg/` is removed from source control (~23 MB of binary artifacts per rebuild commit) and the `web-wasm-rebuild` commit-back workflow is deleted. The wasm is now built where it's consumed: - **Deployment**: a new `wasm-builder` stage in `solitaire_server/Dockerfile` runs `build_wasm.sh` with the same pinned toolchain the old workflow used (wasm-bindgen-cli 0.2.120, wasm-pack 0.14.0, binaryen 130 — release URLs verified); the runtime image copies `pkg/` from that stage. The image build is the artifacts' single source of truth. - **E2E**: `web-e2e` builds the wasm before Playwright (play_canvas.spec drives the real canvas), and its trigger paths now include `solitaire_web`/`solitaire_engine`/`solitaire_data`/`build_wasm.sh`, which it silently missed before. - **docker-build** also triggers on `solitaire_data/**` and `build_wasm.sh` now, so every wasm-affecting master change redeploys without the intermediate bot commit. - `scripts/watch_deploy.sh` no longer waits on the deleted workflow; stale comments in `test.yml`, `build_wasm.sh`, and ARCHITECTURE.md updated. - Self-hosters serving `/web` or `/play` from a source checkout run `./build_wasm.sh` once; `pkg/` is gitignored. Notes for review: the Dockerfile stage mirrors the old workflow's proven build (same script, same pins), but the first `docker-build` run on master is the real proving ground — the image build gets ~15-25 min slower on wasm-affecting changes (no more free ride on the committed artifacts), amortized by the buildx registry cache for server-only changes. `cargo test --workspace` and `cargo clippy --workspace -- -D warnings` are clean (no Rust changes). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-07-09 20:15:40 +00:00
The wasm bundles in solitaire_server/web/pkg/ are no longer tracked. The
web-wasm-rebuild workflow (which rebuilt them in CI and committed them
back to master) is gone; instead:

- solitaire_server/Dockerfile gains a wasm-builder stage that runs
  build_wasm.sh with the same pinned toolchain (wasm-bindgen 0.2.120,
  wasm-pack 0.14.0, binaryen 130) and the runtime image copies pkg/
  from it — the image build is now the artifacts' single source of truth.
- web-e2e builds the wasm before Playwright runs, and its trigger paths
  now include the wasm-feeding crates it actually tests.
- docker-build triggers on solitaire_data/** and build_wasm.sh too, so
  every wasm-affecting change redeploys.
- Self-hosters serving /web or /play from a source checkout run
  ./build_wasm.sh once (script header and ARCHITECTURE.md updated).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 force-pushed fix/156-wasm-in-ci from e92fb75dd9 to ea8d8eee9a 2026-07-09 20:15:40 +00:00 Compare
funman300 merged commit 1aad3251ba into master 2026-07-09 21:57:57 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#168