|
41 | 41 | - uses: arduino/setup-protoc@v3 |
42 | 42 | with: |
43 | 43 | repo-token: ${{ secrets.GITHUB_TOKEN }} |
44 | | - |
| 44 | + |
45 | 45 | - name: Install wasm-pack |
46 | 46 | run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
47 | 47 |
|
@@ -290,3 +290,55 @@ jobs: |
290 | 290 | with: |
291 | 291 | files: | |
292 | 292 | ${{ steps.artifacts.outputs.file_name }} |
| 293 | +
|
| 294 | + publish-npm: |
| 295 | + name: Publish npm packages |
| 296 | + needs: prepare |
| 297 | + runs-on: ubuntu-latest |
| 298 | + |
| 299 | + steps: |
| 300 | + - uses: actions/checkout@v3 |
| 301 | + |
| 302 | + - uses: dtolnay/rust-toolchain@master |
| 303 | + name: Rust Toolchain Setup |
| 304 | + with: |
| 305 | + targets: wasm32-unknown-unknown |
| 306 | + toolchain: ${{ env.RUST_VERSION }} |
| 307 | + |
| 308 | + - uses: Swatinem/rust-cache@v1 |
| 309 | + with: |
| 310 | + cache-on-failure: true |
| 311 | + |
| 312 | + - uses: arduino/setup-protoc@v3 |
| 313 | + with: |
| 314 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 315 | + |
| 316 | + - name: Install wasm-pack |
| 317 | + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
| 318 | + |
| 319 | + - uses: pnpm/action-setup@v2 |
| 320 | + with: |
| 321 | + version: 8 |
| 322 | + |
| 323 | + - uses: actions/setup-node@v3 |
| 324 | + with: |
| 325 | + node-version: "20" |
| 326 | + registry-url: "https://registry.npmjs.org" |
| 327 | + |
| 328 | + - name: Install dependencies |
| 329 | + run: pnpm install |
| 330 | + |
| 331 | + - name: Build packages |
| 332 | + run: pnpm run build |
| 333 | + |
| 334 | + - name: Publish torii-wasm |
| 335 | + working-directory: packages/torii-wasm |
| 336 | + run: npm publish --access public |
| 337 | + env: |
| 338 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 339 | + |
| 340 | + - name: Publish torii-client |
| 341 | + working-directory: packages/torii-client |
| 342 | + run: npm publish --access public |
| 343 | + env: |
| 344 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments