Improve release workflow to handle draft releases#4
Merged
Conversation
The detect_version job treated any existing release (including the draft created by an earlier run) as 'already released' and set is_new_version=false, which skipped the release job. As a result a draft for an unchanged version kept the distribution and target SHA from the first commit, and the edit/clobber path in the release job was effectively unreachable. Distinguish drafts from published releases via gh release view's isDraft field: a published release or git tag is final and is still skipped, while an existing draft now rebuilds so its assets are re-uploaded. Also pass --target on gh release edit so the refreshed draft points at the latest commit. https://claude.ai/code/session_018XCj3HBJS5eEcXCT9dA5GQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of change does this PR introduce?
Description of the PR:
This PR improves the GitHub Actions release workflow to properly handle draft releases:
Separate git tag and release checks: The version check now distinguishes between git tags (which indicate a final release) and GitHub releases (which may be drafts). A published git tag will always skip publishing, but a draft release will be rebuilt.
Draft release detection: Added logic to detect whether an existing release is a draft or published using
gh release viewwith JSON output. Draft releases are treated as incomplete and will be rebuilt on subsequent runs.Update release target commit: When editing a draft release, the
--targetflag is now set to$GITHUB_SHAto ensure the release points to the latest commit from the current push, rather than remaining stuck on the first run's commit.This ensures that:
Additional information:
The changes maintain backward compatibility while fixing the issue where draft releases would not be updated on subsequent workflow runs. The workflow now correctly handles the three states: new version, existing draft (rebuild), and existing published release (skip).
https://claude.ai/code/session_018XCj3HBJS5eEcXCT9dA5GQ