Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,29 @@ jobs:
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-action@stable
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/
~/.cargo/git/
target/
key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }}

- name: Install wasm-pack
run: cargo install wasm-pack
- name: Install wasm-pack and wasm-bindgen
run: |
command -v wasm-pack || cargo install wasm-pack
command -v wasm-bindgen || cargo install wasm-bindgen-cli --version 0.2.100

- name: Build WASM
run: |
cd crates/tokenizers-wasm
RUSTFLAGS='--cfg=getrandom_backend="wasm_js"' wasm-pack build --target web --out-dir ../../docs/pkg --mode no-install
RUSTFLAGS='--cfg=getrandom_backend="wasm_js"' wasm-pack build --target web --out-dir ../../docs/pkg

- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
Loading