Skip to content

Publish to npm

Publish to npm #1

Workflow file for this run

name: Publish to npm
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "Tag to publish"
required: false
default: "latest"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install
- name: Build package
run: npm run build
- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Publish to npm
run: npm publish