From 578d48ac0a73212d599a675f5338eafc66b6b0a3 Mon Sep 17 00:00:00 2001 From: Thomas Behan Date: Mon, 27 Jul 2026 01:16:42 +0100 Subject: [PATCH] fix(ci): Release workflow failed on every tag whose release already existed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `gh release edit` has no `--generate-notes` flag, so the "release already exists" branch could never succeed — it only ever passed when the release was missing and the `create` path ran. Pushing the v5.0.0 tag hit the broken branch and failed. An existing release is now left untouched rather than edited. Beyond fixing the crash, regenerating notes would have overwritten the curated release notes and the uploaded model assets with autogenerated changelog text. --- .github/workflows/release.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 866a33e..cb9669e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,8 @@ name: Release -# On a version tag, ensure a GitHub Release exists with generated notes. The trained model -# artifacts (LesNet.M4.5*.keras / .artifacts.json / .tflite) are uploaded to this release by -# the model-build automation (gh release upload) — they are too large to live in the repo/CI. +# On a version tag, ensure a GitHub Release exists. Trained model artifacts (the JEPA family +# tarballs, LesNet.M4.5*.keras / .artifacts.json / .tflite) are uploaded to the release separately +# by the model-build automation (gh release upload) — far too large to live in the repo/CI. on: push: tags: @@ -16,12 +16,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Create or update the release + - name: Create the release if it does not already exist env: GH_TOKEN: ${{ github.token }} run: | + # An existing release is left alone: it normally already carries curated notes and + # uploaded model assets, and regenerating notes would silently overwrite them. + # The previous version called `gh release edit --generate-notes`, which is not a valid + # flag for `edit`, so this step failed every time the release already existed. if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then - gh release edit "${GITHUB_REF_NAME}" --generate-notes + echo "Release ${GITHUB_REF_NAME} already exists - leaving notes and assets untouched." else - gh release create "${GITHUB_REF_NAME}" --generate-notes --title "LesNet ${GITHUB_REF_NAME}" + gh release create "${GITHUB_REF_NAME}" \ + --generate-notes --title "LesNet ${GITHUB_REF_NAME}" fi