Skip to content

CD Build and Publish to NPM #32

CD Build and Publish to NPM

CD Build and Publish to NPM #32

Workflow file for this run

name: CD Build and Publish to NPM
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v5
with:
cache: yarn
node-version-file: .nvmrc
- name: Yarn Install
run: yarn
- name: Lint
run: yarn lint
- name: Jest Tests
run: yarn test --coverage
- name: Typescript build
run: yarn build
- name: Publish npm package
if: ${{ !github.event.release.prerelease }}
run: npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish npm package (pre-release)
if: ${{ github.event.release.prerelease }}
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}