Skip to content

v2.2.3

v2.2.3 #58

Workflow file for this run

name: Create version packages PR or release
on:
release:
types: [published]
workflow_dispatch: # Allow manual triggering of the workflow
inputs:
tag:
description: "Tag to release"
required: true
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
NODE_VERSION: 22.18.0
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Set tag name
id: set-tag
run: echo "TAG_NAME=${{ github.event.release.tag_name || github.event.inputs.tag }}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Use the tag associated with the release
ref: ${{ env.TAG_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node from .nvmrc
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Update npm for OIDC support
run: npm install -g npm@11.5.1 # Minimum version required for OIDC
- name: Determine NPM tag
id: determine-tag
run: |
if [[ ${{ env.TAG_NAME }} =~ .*-([a-zA-Z]+).* ]]; then
# Extract the identifier between the hyphen and the first dot
PRERELEASE_TAG=${BASH_REMATCH[1]}
echo "NPM_TAG=$PRERELEASE_TAG" >> $GITHUB_ENV
else
echo "NPM_TAG=latest" >> $GITHUB_ENV
fi
- name: Debug Tag Extraction
run: |
echo "Input TAG_NAME: ${{ env.TAG_NAME }}"
echo "Extracted NPM_TAG: ${{ env.NPM_TAG }}"
- name: Publish to NPM
run: npm publish --provenance --tag ${{ env.NPM_TAG }}
env:
NPM_TOKEN: '' # Empty string forces OIDC