Skip to content

Improve release workflow to handle draft releases#4

Merged
wl2027 merged 1 commit into
mainfrom
claude/vigilant-fermat-2wcF8
Jun 6, 2026
Merged

Improve release workflow to handle draft releases#4
wl2027 merged 1 commit into
mainfrom
claude/vigilant-fermat-2wcF8

Conversation

@wl2027

@wl2027 wl2027 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

What type of change does this PR introduce?

  • Bug fix. Bug修复
  • New feature. 新功能
  • Code style update. 代码风格更新
  • Refactoring. 功能重构
  • Build-related changes. 编译&构建相关的更改
  • Other, please describe: 其他,请描述:

Description of the PR:

This PR improves the GitHub Actions release workflow to properly handle draft releases:

  1. 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.

  2. Draft release detection: Added logic to detect whether an existing release is a draft or published using gh release view with JSON output. Draft releases are treated as incomplete and will be rebuilt on subsequent runs.

  3. Update release target commit: When editing a draft release, the --target flag is now set to $GITHUB_SHA to 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:

  • Published releases are never rebuilt
  • Draft releases are automatically refreshed with the latest assets and target the correct commit
  • New versions are properly released as expected

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

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
@wl2027 wl2027 merged commit 5b36615 into main Jun 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants