# cimery — WASM/PWA build (Sprint 22, ADR-001 dual-target) # # Builds cimery-viewer as a WebAssembly application. # wgpu supports WebGPU (Chromium MVP), winit supports browser events. # # Constraints: # - OCCT is NOT available for WASM (--features occt excluded) # - Target: wasm32-unknown-unknown # - Packager: wasm-bindgen-cli # # Build output: pkg/ directory → deploy to Cloudflare Pages (cimery-web.pages.dev) name: WASM on: push: branches: [main] paths: - 'crates/viewer/**' - 'crates/kernel/**' - 'crates/ir/**' - 'crates/core/**' - '.github/workflows/wasm.yml' workflow_dispatch: # manual trigger env: CARGO_TERM_COLOR: always jobs: build-wasm: name: Build WASM runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Build WASM (cimery-viewer) run: | wasm-pack build crates/viewer --target web --out-dir ../../pkg \ --no-default-features --features wasm # Note: 'wasm' feature gates winit/wgpu for web target # OCCT is always excluded for WASM - name: Upload WASM artifacts uses: actions/upload-artifact@v4 with: name: wasm-pkg path: pkg/ retention-days: 7 # ── Deploy to Cloudflare Pages (on main only) ────────────────────────────── deploy-pages: name: Deploy to Cloudflare Pages needs: build-wasm runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' environment: name: cimery-web url: https://cimery-web.pages.dev steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: name: wasm-pkg path: pkg/ - name: Deploy to Cloudflare Pages uses: cloudflare/pages-action@v1 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: cimery-web directory: pkg