2828 steps :
2929 - uses : actions/checkout@v3
3030
31+ - name : Extract tag version
32+ id : get_version
33+ run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
34+
35+ - name : Update package versions
36+ run : |
37+ cd packages/torii-wasm && npm version $VERSION --no-git-tag-version
38+ cd ../torii-client && npm version $VERSION --no-git-tag-version
39+
3140 - uses : dtolnay/rust-toolchain@master
3241 name : Rust Toolchain Setup
3342 with :
@@ -41,16 +50,31 @@ jobs:
4150 - uses : arduino/setup-protoc@v3
4251 with :
4352 repo-token : ${{ secrets.GITHUB_TOKEN }}
44-
53+
4554 - name : Install wasm-pack
4655 run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
4756
57+ - uses : actions/setup-node@v3
58+ with :
59+ node-version : " 20"
60+ registry-url : " https://registry.npmjs.org"
61+
62+ - uses : pnpm/action-setup@v2
63+ with :
64+ version : 10
65+
66+ - name : Install dependencies
67+ run : pnpm install
68+
4869 - name : Build WASM (no-modules)
4970 run : wasm-pack build crates/wasm --out-dir ../../pkg-no-modules --release --target no-modules
5071
5172 - name : Build WASM (web)
5273 run : wasm-pack build crates/wasm --out-dir ../../pkg-web --release --target web
5374
75+ - name : Build packages
76+ run : pnpm run build
77+
5478 - name : Package WASM builds
5579 id : wasm_artifacts
5680 shell : bash
6791 torii-wasm-no-modules.tar.gz
6892 torii-wasm-web.tar.gz
6993
94+ - name : Publish torii-wasm
95+ working-directory : packages/torii-wasm
96+ run : pnpm publish --access public
97+ if : startsWith(github.ref, 'refs/tags/')
98+ env :
99+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
100+
101+ - name : Publish torii-client
102+ working-directory : packages/torii-client
103+ run : pnpm publish --access public
104+ if : startsWith(github.ref, 'refs/tags/')
105+ env :
106+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
107+
70108 build-uniffi :
71109 name : Build UniFFI bindings
72110 needs : prepare
@@ -290,3 +328,4 @@ jobs:
290328 with :
291329 files : |
292330 ${{ steps.artifacts.outputs.file_name }}
331+
0 commit comments