name: Release

on:
  push:
    tags:
      - "**.**.**"

permissions:
  id-token: write  # Required for NPM OIDC
  contents: read  # Required for actions/checkout

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          persist-credentials: false
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '24'
          registry-url: 'https://registry.npmjs.org'
      - run: yarn
      - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
      - run: npm version $VERSION --git-tag-version=false --allow-same-version
      - run: npm publish
