From 8e4c9e21819a23d064ad7bc2fd10746a1bb2534b Mon Sep 17 00:00:00 2001 From: epwalsh Date: Sun, 1 Sep 2024 19:14:58 -0700 Subject: [PATCH] guard against duplicate tags --- src/scripts/release.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scripts/release.sh b/src/scripts/release.sh index 497c3ad3..5b9df6ed 100755 --- a/src/scripts/release.sh +++ b/src/scripts/release.sh @@ -5,6 +5,14 @@ set -e TAG=$(python -c 'from olmo_core.version import VERSION; print("v" + VERSION)') git pull + +# Make sure tag/release doesn't already exist. +STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://github.com/allenai/OLMo-core/releases/tag/${TAG}") +if [[ $STATUS_CODE == "200" ]]; then + echo "Release tag ${TAG} already exists" + exit 1 +fi + python src/scripts/prepare_changelog.py read -rp "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt