From 5b863012ad054a6dafd587fe4918cd6d2e7d3eea Mon Sep 17 00:00:00 2001 From: kerthcet Date: Mon, 3 Aug 2026 13:28:14 +0100 Subject: [PATCH] create or update the release Signed-off-by: kerthcet --- .github/workflows/release.yaml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 689e788..b28839e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -91,12 +91,23 @@ jobs: sha256sum sandd-* > sandd-checksums.txt cat sandd-checksums.txt - - name: Create release + - name: Create or update release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create "$GITHUB_REF_NAME" \ - --repo "$GITHUB_REPOSITORY" \ - --title "$GITHUB_REF_NAME" \ - --generate-notes \ - artifacts/* + # A release for this tag may already exist (e.g. cut by hand, or a + # re-run of this workflow). `gh release create` hard-fails in that + # case, so upload the assets to the existing release instead. + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + echo "Release $GITHUB_REF_NAME already exists; uploading assets." + gh release upload "$GITHUB_REF_NAME" \ + --repo "$GITHUB_REPOSITORY" \ + --clobber \ + artifacts/* + else + gh release create "$GITHUB_REF_NAME" \ + --repo "$GITHUB_REPOSITORY" \ + --title "$GITHUB_REF_NAME" \ + --generate-notes \ + artifacts/* + fi