Fix CI: delete existing release before creating a new one
All checks were successful
Release / build-and-release (push) Successful in 26m38s
All checks were successful
Release / build-and-release (push) Successful in 26m38s
Prevents "Release has no Tag" error when re-running a build for a tag that already has a release. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e3992298f0
commit
c777dbb7b8
1 changed files with 11 additions and 0 deletions
|
|
@ -152,6 +152,17 @@ jobs:
|
|||
**Windows** : Téléchargez le fichier \`.exe\` ci-dessous.
|
||||
**Linux** : Téléchargez le fichier \`.deb\` ou \`.AppImage\` ci-dessous."
|
||||
|
||||
# Delete existing release for this tag (if any) to allow re-creation
|
||||
EXISTING=$(curl -s "${API_URL}/repos/${REPO}/releases/tags/${TAG}" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}")
|
||||
EXISTING_ID=$(echo "$EXISTING" | jq -r '.id // empty')
|
||||
if [ -n "$EXISTING_ID" ]; then
|
||||
echo "Deleting existing release ID: $EXISTING_ID"
|
||||
curl -s -X DELETE \
|
||||
"${API_URL}/repos/${REPO}/releases/${EXISTING_ID}" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}"
|
||||
fi
|
||||
|
||||
# Create release
|
||||
RELEASE_RESPONSE=$(curl -s -X POST \
|
||||
"${API_URL}/repos/${REPO}/releases" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue