We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a53aeb commit e087376Copy full SHA for e087376
1 file changed
.github/workflows/ci.yml
@@ -50,7 +50,20 @@ jobs:
50
- name: Publish to npm
51
env:
52
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53
- run: pnpm publish --access public
+ run: |
54
+ # Extract version from package.json
55
+ VERSION=$(node -p "require('./package.json').version")
56
+
57
+ # Check if it's a prerelease version (contains a hyphen, e.g., 3.0.0-alpha.0)
58
+ if [[ "$VERSION" == *-* ]]; then
59
+ # Extract the prerelease tag (e.g., "alpha" from "3.0.0-alpha.0")
60
+ PRERELEASE_TAG=$(echo "$VERSION" | sed 's/.*-\([a-zA-Z]*\).*/\1/')
61
+ echo "Publishing prerelease version $VERSION with tag: $PRERELEASE_TAG"
62
+ pnpm publish --access public --tag "$PRERELEASE_TAG"
63
+ else
64
+ echo "Publishing stable version $VERSION"
65
+ pnpm publish --access public
66
+ fi
67
68
deploy-docs:
69
needs: build-and-test
0 commit comments