name: publish npm repos CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:
    environment: common
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    strategy:
      matrix:
        node-version: [24.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v6
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v6
      with:
        node-version: ${{ matrix.node-version }}
        always-auth: true
        cache: 'npm'
        registry-url: 'https://registry.npmjs.org'
    - run: npm -v
    - run: npm ci
    - run: npm run build
    - name: trust publish
      run: npm publish

