feat: update #90
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: 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 |