Add bump gpui script (#39833)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki
2025-10-09 04:15:37 +00:00
committed by GitHub
parent 3d200a5466
commit 15c4aadb57
3 changed files with 48 additions and 69 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Ensure we're in a clean state on an up-to-date `main` branch.
if [[ -n $(git status --short --untracked-files=no) ]]; then
echo "can't bump versions with uncommitted changes"
exit 1
fi
if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then
echo "this command must be run on main"
exit 1
fi
git pull -q --ff-only origin main
# Parse the current version
version=$(script/get-crate-version gpui)
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
next_minor=$(expr $minor + 1)
next_minor_branch_name="gpui-v${major}.${next_minor}.0"
git checkout -b ${next_minor_branch_name}
script/lib/bump-version.sh gpui v "-gpui" minor true
git checkout -q main
+16
View File
@@ -6,6 +6,7 @@ package=$1
tag_prefix=$2
tag_suffix=$3
version_increment=$4
gpui_release=${5:-false}
if [[ -n $(git status --short --untracked-files=no) ]]; then
echo "can't bump version with uncommitted changes"
@@ -25,6 +26,20 @@ tag_name=${tag_prefix}${new_version}${tag_suffix}
git commit --quiet --all --message "${package} ${new_version}"
git tag ${tag_name}
if [[ "$gpui_release" == "true" ]]; then
cat <<MESSAGE
Locally committed and tagged ${package} version ${new_version}
To push this (don't forget to open a PR!):
git push origin ${tag_name}; gh pr create -H ${branch_name}
To undo this:
git branch -D ${branch_name} && git tag -d ${tag_name}
MESSAGE
else
cat <<MESSAGE
Locally committed and tagged ${package} version ${new_version}
@@ -37,3 +52,4 @@ To undo this:
git reset --hard ${old_sha} && git tag -d ${tag_name}
MESSAGE
fi