Skip to content

chore(ci): update npm publishing configuration (#964) #4

chore(ci): update npm publishing configuration (#964)

chore(ci): update npm publishing configuration (#964) #4

Workflow file for this run

name: Publish to npm
on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*'
permissions:
contents: read
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Build
run: npm run build
- name: Publish to NPM
run: |
if [[ "${{ github.ref_name }}" == *"-alpha"* ]]; then
npm publish --provenance --access public --tag alpha
elif [[ "${{ github.ref_name }}" == *"-beta"* ]]; then
npm publish --provenance --access public --tag beta
else
npm publish --provenance --access public
fi