Skip to content

Fix GHA to detect version change #47

Fix GHA to detect version change

Fix GHA to detect version change #47

Workflow file for this run

name: Release and Publish
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release-and-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: precise
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: 0
- id: version
uses: EndBug/version-check@v2
with:
file-name: ./precise/package.json
diff-search: true
- if: steps.version.outputs.changed == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
generate_release_notes: true
- if: steps.version.outputs.changed == 'true'
uses: actions/setup-node@v6
with:
node-version: '24' # Use latest LTS version
registry-url: https://registry.npmjs.org
- if: steps.version.outputs.changed == 'true'
run: |
npm ci
npm run build
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}