Skip to content

feat: update

feat: update #92

name: Publish canyon-core
on:
push:
branches:
- main # 每次推送到主分支时触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build Wasm package
working-directory: packages/canyon-core
run: |
wasm-pack build --target bundler
- name: Publish to npm
working-directory: packages/canyon-core/pkg
env:
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish