Release WASM #15
Workflow file for this run
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: Release WASM | |
on: | |
push: | |
tags: | |
- "**[0-9]+.[0-9]+.[0-9]+*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: x86_64-unknown-linux-gnu | |
- name: Build | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
wasm-pack build --target web --release --scope nbittich ./adana-script-wasm | |
wasm-pack pack ./adana-script-wasm/pkg | |
- name: Upload pkg | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pkg | |
path: adana-script-wasm/pkg | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download pkg | |
uses: actions/download-artifact@v4 | |
with: | |
name: pkg | |
path: pkg | |
- name: Setup NPM | |
uses: actions/setup-node@v4 | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Publish on NPM | |
run: | | |
cd pkg | |
npm install | |
npm publish --access public |