Skip to content

feat: Update npm-publish workflow to update package.json version from… #6

feat: Update npm-publish workflow to update package.json version from…

feat: Update npm-publish workflow to update package.json version from… #6

Workflow file for this run

name: Publish to npm Registry
on:
push:
tags:
- '*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get tag version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update package.json version
run: npm version --no-git-tag-version ${{ steps.get_version.outputs.VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci || npm install
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}