BLD - Support updating existing GitHub releases

Update the release workflow to check for an existing release tag before creation. If a release is already present, upload the assets using the --clobber flag to ensure the workflow is idempotent and prevents failures on reruns.
This commit is contained in:
Alec Schitzkat
2026-08-19 16:17:26 +02:00
parent f67872d744
commit 2aee913efc
+15 -7
View File
@@ -106,10 +106,18 @@ jobs:
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "$GITHUB_REF_NAME"
"sky_phone-${GITHUB_REF_NAME}.zip"
"sky_phone-${GITHUB_REF_NAME}.zip.sha256"
--verify-tag
--generate-notes
--title "Sky Phone $GITHUB_REF_NAME"
shell: bash
run: |
set -euo pipefail
archive="sky_phone-${GITHUB_REF_NAME}.zip"
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" "$archive" "${archive}.sha256" --clobber
else
gh release create "$GITHUB_REF_NAME" \
"$archive" \
"${archive}.sha256" \
--verify-tag \
--generate-notes \
--title "Sky Phone $GITHUB_REF_NAME"
fi