Skip to content

2.1.2

2.1.2 #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
id-token: write
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: npm install -g npm@latest
- name: Extract version from tag
id: tag_version
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
VERSION=${TAG_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION from tag: $TAG_NAME"
- name: Install dependencies
run: npm install
- name: Build workspaces
run: npm run build
- name: Publish packages
run: |
VERSION="${{ steps.tag_version.outputs.version }}"
IS_STABLE=$(echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' && echo true || echo false)
echo "Publishing... $IS_STABLE"
if [ "$IS_STABLE" = "true" ]; then
npm publish --provenance --access public
else
npm publish --provenance --access public --tag next
fi