From 988c5c2c1a6148d82017ae3db7e73c3b276ec213 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 11 Feb 2026 18:28:06 +0100 Subject: [PATCH] chore: enhance npm publish workflow to include version tagging - Updated the npm publish workflow to dynamically determine the package version and apply a beta tag for pre-release versions. - This change ensures that the correct versioning is maintained during the publishing process, improving clarity for users regarding package stability. - Retained existing dry run functionality for testing without actual publishing. --- .github/workflows/npm-publish.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index c471d1559..564e81531 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -98,7 +98,9 @@ jobs: id: publish run: | DRY_RUN="${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}" - npx npm@latest publish --access public $DRY_RUN + VERSION=$(node -p "require('./package.json').version") + TAG=$([[ "$VERSION" == *-* ]] && echo "--tag beta" || echo "") + npx npm@latest publish --access public $TAG $DRY_RUN - name: Publish result if: always() @@ -136,7 +138,9 @@ jobs: id: publish run: | DRY_RUN="${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}" - npx npm@latest publish --access public $DRY_RUN + VERSION=$(node -p "require('./package.json').version") + TAG=$([[ "$VERSION" == *-* ]] && echo "--tag beta" || echo "") + npx npm@latest publish --access public $TAG $DRY_RUN - name: Publish result if: always() @@ -172,7 +176,9 @@ jobs: id: publish run: | DRY_RUN="${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}" - npx npm@latest publish --access public $DRY_RUN + VERSION=$(node -p "require('./package.json').version") + TAG=$([[ "$VERSION" == *-* ]] && echo "--tag beta" || echo "") + npx npm@latest publish --access public $TAG $DRY_RUN - name: Publish result if: always() @@ -205,7 +211,9 @@ jobs: id: publish run: | DRY_RUN="${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}" - npx npm@latest publish --access public $DRY_RUN + VERSION=$(node -p "require('./package.json').version") + TAG=$([[ "$VERSION" == *-* ]] && echo "--tag beta" || echo "") + npx npm@latest publish --access public $TAG $DRY_RUN - name: Publish result if: always() @@ -241,7 +249,9 @@ jobs: id: publish run: | DRY_RUN="${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}" - npx npm@latest publish --access public $DRY_RUN + VERSION=$(node -p "require('./package.json').version") + TAG=$([[ "$VERSION" == *-* ]] && echo "--tag beta" || echo "") + npx npm@latest publish --access public $TAG $DRY_RUN - name: Publish result if: always()