Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify release script to distinguish git tag errors #1745

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ if ! grep '^globus\-compute\-sdk \& globus\-compute\-endpoint v'"$VERSION"'$' do
fi

echo "releasing v$VERSION"
if git tag -s -m "v$VERSION" "$VERSION" ; then
TAG_STDERR="$(git tag -s -m v$VERSION $VERSION 2>&1 > /dev/null)"
if [[ $? == 0 ]]; then
echo "Git tagged $VERSION"
git push origin "$VERSION"
else
elif [[ "$TAG_STDERR" =~ "already exists" ]]; then
read -p "Tag $VERSION already exists. Release packages with this tag anyway? [y/n] " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
[[ $0 = $BASH_SOURCE ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
else
echo "Git tag failed: $TAG_STDERR"
[[ $0 = $BASH_SOURCE ]] && exit 1
fi

pushd compute_sdk
Expand Down
Loading