Skip to content

Save as tool bar button and tweak workbench available features #270

Save as tool bar button and tweak workbench available features

Save as tool bar button and tweak workbench available features #270

Workflow file for this run

name: Publish NPM Package
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Ensure npm >= 11.5.1
run: npm install -g npm@^11.5.1
- name: Clear token-based auth
run: |
echo "NODE_AUTH_TOKEN=" >> $GITHUB_ENV
npm config delete //registry.npmjs.org/:_authToken || true
- name: Enforce OIDC-only auth
run: |
if [ -n "${NODE_AUTH_TOKEN:-}" ]; then
echo "NODE_AUTH_TOKEN is set. Trusted Publishing should not use tokens.";
exit 1;
fi
if npm config get //registry.npmjs.org/:_authToken | grep -qv "undefined"; then
echo "Auth token detected in npm config. Remove token-based auth.";
exit 1;
fi
if [ -f ~/.npmrc ] && grep -Eq "_authToken|_password|:_auth=" ~/.npmrc; then
echo "Auth token detected in ~/.npmrc. Remove token-based auth.";
exit 1;
fi
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Install Emscripten SDK
run: |
if [ ! -d "$HOME/emsdk" ]; then
git clone https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
fi
cd "$HOME/emsdk"
git fetch --tags --force
./emsdk install 4.0.17
./emsdk activate 4.0.17
- name: Set CI version
run: |
node -e 'const fs=require("fs");const pkg=JSON.parse(fs.readFileSync("package.json","utf8"));const base=String(pkg.version||"0.0.0");const run=process.env.GITHUB_RUN_NUMBER||"0";const parts=base.split(".");const major=parts[0]||"0";const minor=parts[1]||"0";pkg.version=`${major}.${minor}.${run}`;fs.writeFileSync("package.json",JSON.stringify(pkg,null,2)+"\n");'
- name: Build package artifacts
run: pnpm build
- name: Publish
run: npm publish --access public --provenance --tag latest --no-git-checks