Skip to content

Workflow file for this run

name: Build with Emscripten and publish to npmjs
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
shell: bash
- name: Build with Emscripten
run: |
source ./emsdk/emsdk_env.sh
npm install
npm run build
cp ./test/llama-3.1-tokenizer.model ./dist/llama-3.1-tokenizer.model
- name: Publish to npmjs registry
run: |
npm config set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
npm publish