Skip to content

Deploy to npm

Deploy to npm #1

Workflow file for this run

name: Deploy to npm
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*" # Trigger on version tags
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
# - name: Run tests
# run: npm test
# env:
# CI: true
- name: Verify package
run: |
npm run build # If you have a build step
npm pack --dry-run # Verify package contents
- name: Publish to npm
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}