ci(release): publish pre-drafted GitHub Releases atomically with assets #410

Merged
Androtim merged 2 commits from upstream-pr/410 into main 2026-12-03 21:20:40 +00:00
Androtim commented 2026-12-03 21:01:44 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T21:01:44Z.


Summary

Updates the Publish GitHub Release step in .github/workflows/release.yml so pre-drafted releases are published atomically with their release assets attached:

  • Queries gh api repos/$env:GITHUB_REPOSITORY/releases?per_page=30 (which includes draft releases, unlike tag-based endpoints) and checks for an existing draft matching $tag ( ag_name == and draft == true).
  • When a draft release is found:
    1. Uploads arget/release/MiniVI.exe and MiniVI.exe.sha256 with gh release upload ... --clobber.
    2. Publishes the draft atomically via gh release edit --draft=false, so users and MiniVI-Launcher immediately see both the authored release notes and release binaries together.
  • When no draft exists for $tag, preserves the exact existing gh release create fallback.
  • Checks $LASTEXITCODE after each gh command so a failed upload never publishes an incomplete draft.

Verification

  • Verified YAML and PowerShell syntax (yaml.safe_load + System.Management.Automation.Language.Parser::ParseFile — 0 errors).
  • Verified gh api repos/Androtim/MiniVI/releases?per_page=5 | ConvertFrom-Json field names (id, ag_name, draft) and gh release upload / gh release edit CLI flags.
<!-- greyfinch-sync:Androtim/MiniVI:issue:5634890575 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/410). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T21:01:44Z. --- ## Summary Updates the Publish GitHub Release step in .github/workflows/release.yml so pre-drafted releases are published atomically with their release assets attached: - Queries gh api repos/$env:GITHUB_REPOSITORY/releases?per_page=30 (which includes draft releases, unlike tag-based endpoints) and checks for an existing draft matching $tag ( ag_name == and draft == true). - When a draft release is found: 1. Uploads arget/release/MiniVI.exe and MiniVI.exe.sha256 with gh release upload ... --clobber. 2. Publishes the draft atomically via gh release edit --draft=false, so users and MiniVI-Launcher immediately see both the authored release notes and release binaries together. - When no draft exists for $tag, preserves the exact existing gh release create fallback. - Checks $LASTEXITCODE after each gh command so a failed upload never publishes an incomplete draft. ## Verification - Verified YAML and PowerShell syntax (yaml.safe_load + System.Management.Automation.Language.Parser::ParseFile — 0 errors). - Verified gh api repos/Androtim/MiniVI/releases?per_page=5 | ConvertFrom-Json field names (id, ag_name, draft) and gh release upload / gh release edit CLI flags.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Androtim/MiniVI!410
No description provided.