Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ jobs:
CFLAGS_wasm32_unknown_unknown: "-I${{ github.workspace }}/crates/truss-wasm/wasm-shim"
run: wasm-pack build crates/truss-wasm --target web --release

- name: Strip dead env imports from wasm-bindgen output
run: |
# wasm-opt removes unused C stdlib imports from the binary,
# but wasm-bindgen already generated the JS before wasm-opt ran.
# Strip the dead "env" references so browsers don't choke on
# the bare module specifier.
sed -i '/^import .* from "env"/d' crates/truss-wasm/pkg/truss_wasm.js
sed -i '/"env":/d' crates/truss-wasm/pkg/truss_wasm.js

- name: Prepare deploy directory
run: |
mkdir -p _site/pkg
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ jobs:
CFLAGS_wasm32_unknown_unknown: "-I${{ github.workspace }}/crates/truss-wasm/wasm-shim"
run: wasm-pack build crates/truss-wasm --target web --release

- name: Strip dead env imports from wasm-bindgen output
run: |
sed -i '/^import .* from "env"/d' crates/truss-wasm/pkg/truss_wasm.js
sed -i '/"env":/d' crates/truss-wasm/pkg/truss_wasm.js

- name: Package WASM
run: |
tar czf truss-wasm.tar.gz -C crates/truss-wasm/pkg .
Expand Down