File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 3232 run : |
3333 deno task release
3434
35- - name : Generate datex.js bundle
35+ - name : Generate datex.js bundle for pages (without inline WASM)
3636 run : |
37- deno task build-bundle
37+ deno task build-bundle
38+
39+ - name : Set up GitHub Pages directory with datex.js and WASM
40+ run : |
41+ mkdir -p ./pages
42+ cp ./datex.js ./pages/datex.js
43+ cp ./src/datex-core/datex_core_js.wasm ./pages/datex_core_js.wasm
44+
45+ - name : Generate datex.js bundle for release artifact (with inline WASM)
46+ run : |
47+ deno task build-bundle --inline-wasm
3848
3949 - name : Create Tag
4050 id : create_tag
5464 env :
5565 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5666
57- - name : Set up GitHub Pages directory
58- run : |
59- mkdir -p ./pages
60- cp ./datex.js ./pages/datex.js
61-
6267 - name : Upload build artifacts
6368 uses : actions/upload-pages-artifact@v3
6469 with :
Original file line number Diff line number Diff line change 11import { encodeBase64 } from "jsr:@std/encoding/base64" ;
22
3+ // check if --inline-wasm argument is passed
4+ // if --inline-wasm is passed, the wasm file will be embedded into the bundle
5+ const inlineWASM = Deno . args . includes ( "--inline-wasm" ) ;
6+
37const command = new Deno . Command ( Deno . execPath ( ) , {
48 args : [
59 "bundle" ,
@@ -22,6 +26,12 @@ if (code !== 0) {
2226 Deno . exit ( code ) ;
2327} else {
2428 console . log ( "Script bundled successfully to datex.js" ) ;
29+
30+ if ( ! inlineWASM ) {
31+ console . log ( "Skipping WASM embedding, inline flag not set." ) ;
32+ Deno . exit ( 0 ) ;
33+ }
34+
2535 // replace await WebAssembly.instantiateStreaming(fetch(new URL("datex_core_js.wasm",import.meta.url)) with
2636 // WebAssembly.instantiate inline
2737 const wasmFile = new URL (
You can’t perform that action at this time.
0 commit comments