Skip to content

Commit b3537c3

Browse files
committed
feat: Add WebGPU cube example to GitHub Pages
Update GitHub Pages deployment workflow to include the WebGPU rotating cube example: **Build Steps:** - Copy wasm_exec.js to webgpu-cube directory - Build webgpu-cube WASM binary - Copy built files to _site/webgpu-cube/ for deployment **Landing Page Updates:** - Add WebGPU Rotating Cube to examples list - Include description highlighting 3D graphics, scene graphs, and PBR materials - Add browser compatibility notice for WebGPU requirements (Chrome 113+, Edge 113+) The WebGPU cube will be live at `/webgpu-cube/` when deployed to GitHub Pages, showcasing Guix's ability to handle advanced graphics APIs through WASM.
1 parent ed70da9 commit b3537c3

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ jobs:
4343
if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then
4444
cp "$GOROOT/lib/wasm/wasm_exec.js" examples/counter/
4545
cp "$GOROOT/lib/wasm/wasm_exec.js" examples/calculator/
46+
cp "$GOROOT/lib/wasm/wasm_exec.js" examples/webgpu-cube/
4647
elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
4748
cp "$GOROOT/misc/wasm/wasm_exec.js" examples/counter/
4849
cp "$GOROOT/misc/wasm/wasm_exec.js" examples/calculator/
50+
cp "$GOROOT/misc/wasm/wasm_exec.js" examples/webgpu-cube/
4951
else
5052
echo "wasm_exec.js not found in GOROOT, downloading from GitHub"
5153
curl -o examples/counter/wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
5254
curl -o examples/calculator/wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
55+
curl -o examples/webgpu-cube/wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js
5356
fi
5457
5558
- name: Build counter WASM
@@ -60,17 +63,25 @@ jobs:
6063
working-directory: examples/calculator
6164
run: GOOS=js GOARCH=wasm go build -o main.wasm .
6265

66+
- name: Build WebGPU cube WASM
67+
working-directory: examples/webgpu-cube
68+
run: GOOS=js GOARCH=wasm go build -o main.wasm .
69+
6370
- name: Create Pages structure
6471
run: |
6572
mkdir -p _site
6673
mkdir -p _site/counter
6774
mkdir -p _site/calculator
75+
mkdir -p _site/webgpu-cube
6876
cp examples/counter/index.html _site/counter/
6977
cp examples/counter/main.wasm _site/counter/
7078
cp examples/counter/wasm_exec.js _site/counter/
7179
cp examples/calculator/index.html _site/calculator/
7280
cp examples/calculator/main.wasm _site/calculator/
7381
cp examples/calculator/wasm_exec.js _site/calculator/
82+
cp examples/webgpu-cube/index.html _site/webgpu-cube/
83+
cp examples/webgpu-cube/main.wasm _site/webgpu-cube/
84+
cp examples/webgpu-cube/wasm_exec.js _site/webgpu-cube/
7485
7586
# Create index page with links to examples
7687
cat > _site/index.html << 'EOF'
@@ -153,8 +164,22 @@ jobs:
153164
<strong>Calculator</strong> - Interactive calculator with state management and event handlers
154165
</a>
155166
</li>
167+
<li>
168+
<a href="./webgpu-cube/">
169+
<strong>WebGPU Rotating Cube</strong> - 3D graphics with WebGPU, scene graphs, and PBR materials
170+
</a>
171+
</li>
156172
</ul>
157173
174+
<div class="info">
175+
<h3>Browser Compatibility</h3>
176+
<p>
177+
<strong>Note:</strong> The WebGPU Cube example requires a browser with WebGPU support
178+
(Chrome 113+, Edge 113+, or other WebGPU-enabled browsers). The Counter and Calculator
179+
examples work in all modern browsers.
180+
</p>
181+
</div>
182+
158183
<div class="info">
159184
<h3>Learn More</h3>
160185
<p>

0 commit comments

Comments
 (0)