Skip to content

release: v1.5.1 (#47) #8

release: v1.5.1 (#47)

release: v1.5.1 (#47) #8

Workflow file for this run

name: Publish Package on Version Change
on:
push:
branches:
- master
jobs:
publish-if-version-changed:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if the package version has changed
id: version_check
uses: EndBug/version-check@v2
with:
# Check the version in the root package.json file
diff-search: true
file-name: package.json
- name: If the version has changed, continue with the following steps
if: steps.version_check.outputs.changed == 'true'
run: echo "The version has changed to ${{ steps.version_check.outputs.version }}. Proceeding to publish."
- name: Setup node
if: steps.version_check.outputs.changed == 'true'
uses: actions/setup-node@v4
with:
node-version: '20.18.1'
cache: 'npm'
registry-url: https://registry.npmjs.org
- name: Install dependencies
if: steps.version_check.outputs.changed == 'true'
run: npm ci
- name: Publish to NPM
if: steps.version_check.outputs.changed == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}