Skip to content

Publish to npm

Publish to npm #6

Workflow file for this run

name: Publish to npm
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build library
run: npm run build-package
- name: Publish to npm
run: |
cd dist/ngx-angular-query-builder
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}