From 3f356a0b21f2ad19ca2ae019bd4a873cf57aac31 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 06:49:04 -0800 Subject: [PATCH] fix(block-ci): publish the draft a rerun of block-release finds An interrupted first run can leave the tag with an unpublished draft. The rerun took the existing-release branch, replaced the assets and exited 0 with the release still a draft. Publish after the uploads, keeping it off the repository's Latest. Co-Authored-By: Claude Opus 5.5 --- .github/block/scripts/block-ci-port-test.py | 2 ++ .github/workflows/block-release.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/block/scripts/block-ci-port-test.py b/.github/block/scripts/block-ci-port-test.py index ad5f95f209..e763f03a31 100644 --- a/.github/block/scripts/block-ci-port-test.py +++ b/.github/block/scripts/block-ci-port-test.py @@ -102,6 +102,8 @@ class PortTests(unittest.TestCase): self.assertIn('gh release create "$GITHUB_REF_NAME"', text) self.assertIn('--latest=false', text) self.assertIn('gh release upload "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --clobber', text) + publish = 'gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease" --draft=false --latest=false' + self.assertLess(text.index("--clobber"), text.index(publish)) self.assertIn("runs-on: ubuntu-latest", text) self.assertNotIn("BLOCK_RUNNER_LABEL", text) self.assertIn('sw-block-${version}-linux-amd64.tar.gz', text) diff --git a/.github/workflows/block-release.yml b/.github/workflows/block-release.yml index cab8bd0558..c15d562b5d 100644 --- a/.github/workflows/block-release.yml +++ b/.github/workflows/block-release.yml @@ -140,10 +140,10 @@ jobs: (cd "$out" && sha256sum "$asset" >SHA256SUMS) prerelease=false if [[ "$version" == *-* ]]; then prerelease=true; fi - # A rerun of a published tag replaces its assets instead of failing. + # A rerun replaces the assets, then publishes a draft an interrupted run left. if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then - gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease" gh release upload "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --clobber + gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --prerelease="$prerelease" --draft=false --latest=false else gh release create "$GITHUB_REF_NAME" "$out/$asset" "$out/SHA256SUMS" --repo "$GITHUB_REPOSITORY" --verify-tag --latest=false \ --prerelease="$prerelease" --title "Seaweed Block $version" --notes-file "$NOTES"