Skip to content

Publish to NPM

Publish to NPM #5

Workflow file for this run

name: Publish to NPM
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install
- name: Build the package
working-directory: ./packages/lib
run: yarn build
- name: Configure NPM
working-directory: ./packages/lib
run: |
echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" >> .npmrc
echo "always-auth: true" >> .npmrc
- name: Publish on NPM
working-directory: ./packages/lib
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}