Skip to content

Publish NPM package

Publish NPM package #3

Workflow file for this run

name: Publish NPM package
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm test
publish-npm:
name: upload release to NPM
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
# environment: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}