Skip to content

CD Build and Publish to NPM #37

CD Build and Publish to NPM

CD Build and Publish to NPM #37

Workflow file for this run

name: CD Build and Publish to NPM
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v6
with:
cache: yarn
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
- 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
- name: Publish npm package (pre-release)
if: ${{ github.event.release.prerelease }}
run: npm publish --tag beta