Skip to content

Conversation

@vineethasok
Copy link
Collaborator

Introduces a 'version_bump' input to the publish GitHub Actions workflow, allowing selection of patch, minor, or major version increments before prerelease generation. The script now applies the specified version bump to the base version before determining the next available prerelease version.

There was also an issue with publishing the same beta version on the same version, so added a fix to move the count up so it won't break

Introduces a 'version_bump' input to the publish GitHub Actions workflow, allowing selection of patch, minor, or major version increments before prerelease generation. The script now applies the specified version bump to the base version before determining the next available prerelease version.
@vineethasok vineethasok self-assigned this Jan 8, 2026
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
click-ui Ready Ready Preview, Comment Jan 9, 2026 2:43pm

@vineethasok vineethasok requested a review from ariser January 8, 2026 10:44
Comment on lines 78 to 128
# Apply version bump if requested
BUMP_TYPE="${{ github.event.inputs.version_bump || 'none' }}"
if [ "$BUMP_TYPE" != "none" ]; then
echo "Applying $BUMP_TYPE version bump to $BASE_VERSION"
# Split version into major.minor.patch
IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE_VERSION"
case "$BUMP_TYPE" in
patch)
PATCH=$((PATCH + 1))
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
esac
BASE_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "New base version after bump: $BASE_VERSION"
fi
# Find the next available prerelease number
PRERELEASE_NUM=0
while true; do
TEST_VERSION="${BASE_VERSION}-${GITHUB_TAG}.${PRERELEASE_NUM}"
# Check if this version exists on npm
if npm view @clickhouse/click-ui@${TEST_VERSION} version 2>/dev/null; then
echo "Version ${TEST_VERSION} already exists, trying next number..."
PRERELEASE_NUM=$((PRERELEASE_NUM + 1))
else
# Version doesn't exist, we can use it
NEW_VERSION="${TEST_VERSION}"
break
fi
# Safety limit to prevent infinite loops
if [ $PRERELEASE_NUM -gt 100 ]; then
echo "Error: Too many prerelease versions (>100)"
exit 1
fi
done
echo "Generated prerelease version: $NEW_VERSION"
npm pkg set version=$NEW_VERSION --no-git-tag-version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just npm version $BUMP_TYPE?

done
echo "Generated prerelease version: $NEW_VERSION"
npm pkg set version=$NEW_VERSION --no-git-tag-version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think NEW_VERSION isn't always defined here

Streamlines the publish.yml workflow by removing the version_bump input, consolidating version/tag handling, and improving prerelease version generation. The workflow now auto-increments patch versions for prereleases, sets npm tags more consistently, and adds cleanup for failed releases. This reduces complexity and improves maintainability for both manual and release-triggered publishing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants