diff --git a/script/bump-app-version b/script/bump-app-version index 88433b6c70..a628eb8a6c 100755 --- a/script/bump-app-version +++ b/script/bump-app-version @@ -1,3 +1,18 @@ #!/bin/bash -exec script/lib/bump-version.sh zed v $@ +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 35f333f76a..cc8bb91dbf 100755 --- a/script/bump-collab-version +++ b/script/bump-collab-version @@ -1,3 +1,3 @@ #!/bin/bash -exec script/lib/bump-version.sh collab collab-v $@ +exec script/lib/bump-version.sh collab collab-v '' $@ diff --git a/script/lib/bump-version.sh b/script/lib/bump-version.sh index 205fc168ef..b7b3bc03dc 100755 --- a/script/lib/bump-version.sh +++ b/script/lib/bump-version.sh @@ -2,14 +2,15 @@ set -eu -if [[ $# < 3 ]]; then +if [[ $# < 4 ]]; then echo "Missing version increment (major, minor, or patch)" >&2 exit 1 fi package=$1 tag_prefix=$2 -version_increment=$3 +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" @@ -23,17 +24,17 @@ cargo check --quiet new_version=$(cargo metadata --no-deps --format-version=1 | jq --raw-output ".packages[] | select(.name == \"${package}\") | .version") branch_name=$(git rev-parse --abbrev-ref HEAD) old_sha=$(git rev-parse HEAD) -tag_name=${tag_prefix}${new_version} +tag_name=${tag_prefix}${new_version}${tag_suffix} git commit --quiet --all --message "${package} ${new_version}" git tag ${tag_name} cat <