Skip to content

Publish Package to npmjs #3

Publish Package to npmjs

Publish Package to npmjs #3

Workflow file for this run

name: Publish Package to npmjs
on:
workflow_dispatch:
release:
types: [released]
jobs:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 8.7.1
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
registry-url: 'https://registry.npmjs.org'
- run: pnpm i --frozen-lockfile
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
github:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 8.7.1
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
registry-url: 'https://registry.npmjs.org'
- run: pnpm i --frozen-lockfile
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}