From 2aee913efc324fbd9f15d55b5746514925597554 Mon Sep 17 00:00:00 2001 From: Alec Schitzkat Date: Wed, 19 Aug 2026 16:17:26 +0200 Subject: [PATCH] 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. --- .github/workflows/release.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39b271f..9252511 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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