Skip to content

Commit b6b46a2

Browse files
committed
feat: add web studio with WASM bindings and CI workflows
1 parent 87cfcda commit b6b46a2

33 files changed

+1803
-319
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-release:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Build release binary
26+
run: cargo build --release
27+
28+
- name: Package binary (Unix)
29+
if: runner.os != 'Windows'
30+
run: |
31+
mkdir -p dist
32+
cp target/release/maple dist/maple
33+
tar -czf dist/maple-${{ runner.os }}.tar.gz -C dist maple
34+
35+
- name: Package binary (Windows)
36+
if: runner.os == 'Windows'
37+
run: |
38+
New-Item -ItemType Directory -Force -Path dist | Out-Null
39+
Copy-Item target\\release\\maple.exe dist\\maple.exe
40+
Compress-Archive -Path dist\\maple.exe -DestinationPath dist\\maple-Windows.zip
41+
shell: pwsh
42+
43+
- name: Create GitHub Release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
files: dist/*

.github/workflows/pages.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Web to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
27+
- name: Add wasm target
28+
run: rustup target add wasm32-unknown-unknown
29+
30+
- name: Install wasm-pack
31+
run: cargo install wasm-pack --locked
32+
33+
- name: Set up Bun
34+
uses: oven-sh/setup-bun@v2
35+
with:
36+
bun-version: 1.3.5
37+
38+
- name: Install web deps
39+
run: bun install
40+
working-directory: web
41+
42+
- name: Build WASM
43+
run: bun run build:wasm
44+
working-directory: web
45+
46+
- name: Build site
47+
run: bun run build
48+
working-directory: web
49+
50+
- name: Upload Pages artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: web/dist
54+
55+
deploy:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)