Skip to content

Version 4.0.0-beta.2 #2

Version 4.0.0-beta.2

Version 4.0.0-beta.2 #2

Workflow file for this run

name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: ⬇️ Check out code
uses: actions/checkout@v4
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Build and Publish
run: |
npm ci
npm run build
# print the NPM user name for validation
npm whoami
VERSION=$(node -p "require('./package.json').version" )
# Only publish stable versions to the latest tag
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
NPM_TAG="latest"
else
NPM_TAG="beta"
fi
echo "Publishing $VERSION with $NPM_TAG tag."
npm publish --tag $NPM_TAG --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
CI: true