From 9e5505181195c0a36b1b4e47653d012794328287 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 27 Oct 2022 12:00:45 -0700 Subject: [PATCH] Tweak version-bumping scripts --- script/bump-app-version | 18 ------------------ script/bump-collab-version | 7 ++++++- script/{railcar => bump-zed-minor-versions} | 19 +++++++++---------- script/bump-zed-patch-version | 18 ++++++++++++++++++ script/generate-doc-diagrams | 14 -------------- script/lib/bump-version.sh | 14 ++++---------- 6 files changed, 37 insertions(+), 53 deletions(-) delete mode 100755 script/bump-app-version rename script/{railcar => bump-zed-minor-versions} (85%) create mode 100755 script/bump-zed-patch-version delete mode 100755 script/generate-doc-diagrams diff --git a/script/bump-app-version b/script/bump-app-version deleted file mode 100755 index a628eb8a6c..0000000000 --- a/script/bump-app-version +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -channel=$(cat crates/zed/RELEASE_CHANNEL) - -tag_suffix="" -case $channel; in - stable) - ;; - preview) - tag_suffix="-pre" - ;; - *) - echo "do this on a release branch where RELEASE_CHANNEL is either 'preview' or 'stable'" >&2 - exit 1 - ;; -esac - -exec script/lib/bump-version.sh zed v $tag_suffix $@ diff --git a/script/bump-collab-version b/script/bump-collab-version index cc8bb91dbf..ec64c42e2b 100755 --- a/script/bump-collab-version +++ b/script/bump-collab-version @@ -1,3 +1,8 @@ #!/bin/bash -exec script/lib/bump-version.sh collab collab-v '' $@ +if [[ $# < 1 ]]; then + echo "Missing version increment (major, minor, or patch)" >&2 + exit 1 +fi + +exec script/lib/bump-version.sh collab collab-v '' $1 diff --git a/script/railcar b/script/bump-zed-minor-versions similarity index 85% rename from script/railcar rename to script/bump-zed-minor-versions index 7c98dab212..40009d382a 100755 --- a/script/railcar +++ b/script/bump-zed-minor-versions @@ -7,11 +7,11 @@ which cargo-set-version > /dev/null || cargo install cargo-edit # 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 roll the railcars with uncommitted changes" + echo "can't bump versions with uncommitted changes" exit 1 fi if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then - echo "Run this command on the main branch" + echo "this command must be run on main" exit 1 fi git pull -q --ff-only origin main @@ -28,7 +28,7 @@ next_minor=$(expr $minor + 1) minor_branch_name="v${major}.${minor}.x" prev_minor_branch_name="v${major}.${prev_minor}.x" next_minor_branch_name="v${major}.${next_minor}.x" -preview_tag_name="v{major}.{minor}.{patch}-pre" +preview_tag_name="v${major}.${minor}.${patch}-pre" function cleanup { git checkout -q main @@ -71,13 +71,13 @@ if git show-ref --quiet refs/tags/${stable_tag_name}; then fi old_prev_minor_sha=$(git rev-parse HEAD) echo -n stable > crates/zed/RELEASE_CHANNEL -git commit -q --all --message "Stable ${prev_minor_branch_name}" +git commit -q --all --message "${prev_minor_branch_name} stable" git tag ${stable_tag_name} echo "Creating new preview branch ${minor_branch_name}..." git checkout -q -b ${minor_branch_name} echo -n preview > crates/zed/RELEASE_CHANNEL -git commit -q --all --message "Preview ${minor_branch_name}" +git commit -q --all --message "${minor_branch_name} preview" git tag ${preview_tag_name} echo "Preparing main for version ${next_minor_branch_name}..." @@ -86,10 +86,10 @@ git clean -q -dff old_main_sha=$(git rev-parse HEAD) cargo set-version --package zed --bump minor cargo check -q -git commit -q --all --message "Dev ${next_minor_branch_name}" +git commit -q --all --message "${next_minor_branch_name} dev" cat <&2 + exit 1 + ;; +esac + +exec script/lib/bump-version.sh zed v $tag_suffix patch diff --git a/script/generate-doc-diagrams b/script/generate-doc-diagrams deleted file mode 100755 index 778725282b..0000000000 --- a/script/generate-doc-diagrams +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Install the `plantuml` utility if it is not already installed. -if [[ -x plantuml ]]; then - brew install plantuml -fi - -# Generate SVGs from all of the UML files. -plantuml \ - -nometadata \ - -overwrite \ - -tsvg \ - -o ../svg \ - docs/diagrams/src/* \ No newline at end of file diff --git a/script/lib/bump-version.sh b/script/lib/bump-version.sh index 4b9a1985eb..b0644ed066 100755 --- a/script/lib/bump-version.sh +++ b/script/lib/bump-version.sh @@ -2,18 +2,13 @@ set -eu -if [[ $# < 4 ]]; then - echo "Missing version increment (major, minor, or patch)" >&2 - exit 1 -fi - package=$1 tag_prefix=$2 tag_suffix=$3 version_increment=$4 if [[ -n $(git status --short --untracked-files=no) ]]; then - echo "Can't push a new version with uncommitted changes" + echo "can't bump version with uncommitted changes" exit 1 fi @@ -33,11 +28,10 @@ cat <