Skip to content

Publishing to NPM

Vadim edited this page Nov 13, 2025 · 5 revisions

Projects using this template often rely on GitHub Releases as the primary release source.
However, automated publishing to the NPM Registry can be integrated using the npm-publish GitHub Action.

A minimal workflow that publishes when a GitHub Release becomes public:

name: Publish to NPM
on:
  release:
    types: [published]

jobs:
  npm-publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-node@v6
        with:
          node-version: "24"
      - run: npm ci
      - run: npm test
      - run: npm publish --ignore-scripts
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Clone this wiki locally