Skip to content

Publish to npm.js

Publish to npm.js #1

Workflow file for this run

name: Publish to npm.js
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Set .nvmrc content to stage output
id: nvmrc
run: |
echo "node_version=$(cat .nvmrc | sed 's/v//g')" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvmrc.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}