Skip to content

Publish Package to npmjs #81

Publish Package to npmjs

Publish Package to npmjs #81

Workflow file for this run

name: Publish Package to npmjs
on:
release:
types: [published]
permissions:
id-token: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: git config --global user.name ${{ github.actor }}
- run: git config --global user.email "github-action-${{ github.actor }}.users.noreply.github.com"
- run: npm ci
- run: |
if
[[ ${{ github.event.release.tag_name }} == *'alpha'* ]];
then
npm version ${{ github.event.release.tag_name }};
npm publish --tag alpha;
elif
[[ ${{ github.event.release.tag_name }} == *'beta'* ]];
then
npm version ${{ github.event.release.tag_name }};
npm publish --tag beta;
else
npm publish
fi