From f3dfd5829fb407f321c6220db14606abaa56749c Mon Sep 17 00:00:00 2001 From: Iban Eguia Moraza Date: Sun, 17 Mar 2024 16:58:23 +0100 Subject: [PATCH] Added NPM publish workflow (#3725) * Added publish workflow * Change the job name --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ca7f19df97..84486e6ebcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,42 @@ jobs: --no-git-commit \ skip + npm_publish: + name: Publish NPM package (wasm) + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + profile: minimal + override: true + + - name: Install wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: 'latest' + + - name: Build boa_wasm + run: wasm-pack build --scope boa-dev ./ffi/wasm + + - name: Set-up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Set-up npm config for publishing + run: npm config set -- '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" + + - name: Publish to npm + run: npm publish ./ffi/wasm/pkg --access=public + + doc-publish: name: Publish documentation needs: publish