name: "Publish Package"

on:
  workflow_dispatch

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    strategy:
      matrix:
        node-version: [24]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v6.3.0
        with:
          node-version: ${{ matrix.node-version }}
          registry-url: "https://registry.npmjs.org"
          scope: "@complexthings"

      - name: Install dependencies
        run: npm ci

      - name: Publish to npm
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npm publish --access public