Add GitHub Actions workflow for NPM publishing on release creation

This commit is contained in:
sinanisler
2025-12-22 02:04:53 +03:00
parent 787defcdbf
commit 1f8b6abf15
2 changed files with 450 additions and 370 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Publish to NPM
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci || npm install
- name: Publish to NPM
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}