Conrad IrwinPush branch before tag32cd9562 years agoHistory
39 lines · 910 B · Shell
RawDownload
#!/bin/bash set -eu package=$1tag_prefix=$2tag_suffix=$3version_increment=$4 if [[ -n $(git status --short --untracked-files=no) ]]; then  echo "can't bump version with uncommitted changes"  exit 1fi which cargo-set-version > /dev/null || cargo install cargo-edit --features vendored-opensslwhich jq > /dev/null || brew install jqcargo set-version --package $package --bump $version_incrementcargo check --quiet new_version=$(script/get-crate-version $package)branch_name=$(git rev-parse --abbrev-ref HEAD)old_sha=$(git rev-parse HEAD)tag_name=${tag_prefix}${new_version}${tag_suffix} git commit --quiet --all --message "${package} ${new_version}"git tag ${tag_name} cat <<MESSAGELocally committed and tagged ${package} version ${new_version} To push this:     git push origin ${branch_name} ${tag_name} To undo this:     git reset --hard ${old_sha} && git tag -d ${tag_name} MESSAGE