name: npm publish

permissions:
  contents: read # Required for OIDC
  id-token: write # Required for OIDC

on:
  workflow_call:
  workflow_dispatch:

jobs:
  publish:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    environment: prod

    steps:
      - uses: actions/checkout@v6
        with:
          ref: master
      - uses: actions/setup-node@v6
        with:
          node-version-file: .nvmrc
          package-manager-cache: false # never use caching in release builds
          registry-url: 'https://registry.npmjs.org' 
      - name: Publish Package To npmjs
        run: npm publish
