Skip to content

Publish to npm

Publish to npm #2

Workflow file for this run

name: Publish to npm
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
# No lockfile is committed (package-lock.json is gitignored), so npm ci will fail.
# We also ignore scripts to avoid running "prepare" during install; build is explicit below.
run: npm install --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.TANGO_NPM_TOKEN }}
run: npm publish --access public --provenance