Update Managed Files (#510) #986
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build npm package | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
tags: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
build_crate: | |
name: NPM | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install wasm-pack | |
run: cargo install wasm-pack | |
- name: wasm-pack build and pack | |
run: wasm-pack build --release --target=nodejs wasm && wasm-pack pack wasm | |
- name: Setup Node 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
- name: Test wasm | |
run: node wasm/tests/index.js | |
- name: Upload npm pkg artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: npm-pkg | |
path: ./wasm/pkg/clvm_wasm-*.tgz | |
- name: publish to npmjs.com if tagged | |
if: startsWith(github.event.ref, 'refs/tags') | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.node_auth_token }} | |
package: wasm/pkg/package.json |