@@ -41,10 +41,17 @@ jobs:
4141 - uses : arduino/setup-protoc@v3
4242 with :
4343 repo-token : ${{ secrets.GITHUB_TOKEN }}
44-
44+
4545 - name : Install wasm-pack
4646 run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
4747
48+ - uses : pnpm/action-setup@v2
49+ with :
50+ version : 10
51+
52+ - name : Install dependencies
53+ run : pnpm install
54+
4855 - name : Build WASM (no-modules)
4956 run : wasm-pack build crates/wasm --out-dir ../../pkg-no-modules --release --target no-modules
5057
6774 torii-wasm-no-modules.tar.gz
6875 torii-wasm-web.tar.gz
6976
77+ - name : Build packages
78+ run : pnpm run build
79+
80+ - name : Publish torii-wasm
81+ working-directory : packages/torii-wasm
82+ run : npm publish --access public
83+ env :
84+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
85+
86+ - name : Publish torii-client
87+ working-directory : packages/torii-client
88+ run : npm publish --access public
89+ env :
90+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
91+
7092 build-uniffi :
7193 name : Build UniFFI bindings
7294 needs : prepare
@@ -290,3 +312,55 @@ jobs:
290312 with :
291313 files : |
292314 ${{ steps.artifacts.outputs.file_name }}
315+
316+ publish-npm :
317+ name : Publish npm packages
318+ needs : prepare
319+ runs-on : ubuntu-latest
320+
321+ steps :
322+ - uses : actions/checkout@v3
323+
324+ - uses : dtolnay/rust-toolchain@master
325+ name : Rust Toolchain Setup
326+ with :
327+ targets : wasm32-unknown-unknown
328+ toolchain : ${{ env.RUST_VERSION }}
329+
330+ - uses : Swatinem/rust-cache@v1
331+ with :
332+ cache-on-failure : true
333+
334+ - uses : arduino/setup-protoc@v3
335+ with :
336+ repo-token : ${{ secrets.GITHUB_TOKEN }}
337+
338+ - name : Install wasm-pack
339+ run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
340+
341+ - uses : pnpm/action-setup@v2
342+ with :
343+ version : 8
344+
345+ - uses : actions/setup-node@v3
346+ with :
347+ node-version : " 20"
348+ registry-url : " https://registry.npmjs.org"
349+
350+ - name : Install dependencies
351+ run : pnpm install
352+
353+ - name : Build packages
354+ run : pnpm run build
355+
356+ - name : Publish torii-wasm
357+ working-directory : packages/torii-wasm
358+ run : npm publish --access public
359+ env :
360+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
361+
362+ - name : Publish torii-client
363+ working-directory : packages/torii-client
364+ run : npm publish --access public
365+ env :
366+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments