Add npm publishing automation

This commit is contained in:
Federico Jaramillo Martinez
2026-05-08 16:55:24 +02:00
parent 5b339e192d
commit d602e4857a
5 changed files with 378 additions and 6 deletions
+40
View File
@@ -0,0 +1,40 @@
name: Publish npm package
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
environment: npm
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify
run: npm run verify
- name: Build
run: npm run build
- name: Publish
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}