Skip to content

Publishing to NPM

Vadim edited this page Nov 13, 2025 · 5 revisions

Publishing to NPM

This template focuses on semantic versioning and GitHub Releases. However, publishing to the NPM Registry can be integrated using the npm-publish GitHub Action.

Basic Workflow

A minimal workflow that publishes whenever a GitHub Release is created:

on:
  push:
    tags: v*
jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-node@v5
        with:
          node-version: "24"
          registry-url: "https://registry.npmjs.org"
      - run: npm ci
      - run: npm test
      - run: npm publish --provenance --ignore-scripts
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Clone this wiki locally