Skip to content

[ci] (fix): revert trigger configuration #11

[ci] (fix): revert trigger configuration

[ci] (fix): revert trigger configuration #11

name: Publish to NPM
on:
push:
branches:
- release
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- name: Setup .npmrc (NPM)
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
scope: '@arunabot'
- name: Get Current version
id: current_version
run: echo ::set-output name=version::$(node -p "require('./package.json').version")
- name: Get current npm version
id: npm_version
run: echo ::set-output name=version::$(npm view arunabase version)
- name: Compare versions and skip if same
id: compare_versions
if: ${{ steps.current_version.outputs.version == steps.npm_version.outputs.version }}
run: echo ::set-output name=skip::true && echo "Skipping publish as versions are same" && exit 0
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}