diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml
index e21e51a..fc820af 100644
--- a/.github/workflows/static.yaml
+++ b/.github/workflows/static.yaml
@@ -1,11 +1,9 @@
-name: bip322.rs Website
+name: bip322.rs
on:
push:
branches: ["master"]
- workflow_dispatch:
-
permissions:
contents: read
pages: write
@@ -24,12 +22,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
+
+ - name: Setup Rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ target: wasm32-unknown-unknown
+
+ - name: Install wasm-pack
+ run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
+
+ - name: Build WASM
+ run: |
+ cd www
+ wasm-pack build \
+ --target web \
+ --out-name bip322 \
+ www
+ cp www/pkg/bip322.js www/pkg/bip322_bg.wasm www
+
- name: Setup Pages
uses: actions/configure-pages@v5
+
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './www'
+
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
+
diff --git a/README.md b/README.md
index 2c99091..8db5aed 100644
--- a/README.md
+++ b/README.md
@@ -23,9 +23,9 @@ For MacOs:
```
brew install llvm
cargo install wasm-pack
-rustup toolchain install nightly
-rustup target add wasm32-unknown-unknown --toolchain nightly
-rustup default nightly-aarch64-apple-darwin
+rustup target add wasm32-unknown-unknown
cd www
-AR=/opt/homebrew/opt/llvm/bin/llvm-ar CC=/opt/homebrew/opt/llvm/bin/clang wasm-pack build --target web --no-typescript
+AR=/opt/homebrew/opt/llvm/bin/llvm-ar \
+CC=/opt/homebrew/opt/llvm/bin/clang \
+ wasm-pack build --target web
```
diff --git a/justfile b/justfile
index 9f48a33..706f4bb 100644
--- a/justfile
+++ b/justfile
@@ -20,6 +20,18 @@ outdated:
coverage:
cargo llvm-cov
+wasm:
+ AR=/opt/homebrew/opt/llvm/bin/llvm-ar \
+ CC=/opt/homebrew/opt/llvm/bin/clang \
+ wasm-pack build \
+ --target web \
+ --out-name bip322 \
+ www
+ cp www/pkg/bip322.js www/pkg/bip322_bg.wasm www
+
+serve: wasm
+ python3 -m http.server -b 127.0.0.1 -d www 8080
+
prepare-release revision='master':
#!/usr/bin/env bash
set -euxo pipefail
diff --git a/www/index.html b/www/index.html
index 3633d73..e328f2a 100644
--- a/www/index.html
+++ b/www/index.html
@@ -24,74 +24,7 @@
github
crate
-
-
+