From ed13bdb5b5d0c82927a51c61296664d62fd7088e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 25 Jun 2025 22:11:44 +1200 Subject: [PATCH] Modify bb64/publish.sh --- bb64/publish.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bb64/publish.sh b/bb64/publish.sh index f914d87..9c8ac38 100755 --- a/bb64/publish.sh +++ b/bb64/publish.sh @@ -77,6 +77,23 @@ if [ -z "$RELEASE_WRITE_TOKEN" ]; then exit 1 fi +# Create and push git tag +echo "Creating git tag $TAG..." +# Check if tag already exists +if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG already exists, deleting it first..." + git tag -d "$TAG" + git push origin --delete "$TAG" || true +fi + +git tag -a "$TAG" -m "Release $TAG" +if ! git push origin "$TAG"; then + echo "Failed to push tag $TAG to origin" >&2 + # Try to delete local tag if push failed + git tag -d "$TAG" + exit 1 +fi + echo "Creating release $TAG on Gitea..." RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \ -H "Content-Type: application/json" \