Skip to content

fix(ci): prevent maintenance branch releases from being marked latest - #2241

Merged
butler54 merged 1 commit into
developfrom
fix/maintenance-branch-release-latest
May 22, 2026
Merged

fix(ci): prevent maintenance branch releases from being marked latest#2241
butler54 merged 1 commit into
developfrom
fix/maintenance-branch-release-latest

Conversation

@butler54

Copy link
Copy Markdown
Collaborator

Summary

Fixes two bugs in the release workflow when deploying from maintenance branches (e.g. v3):

  1. v3 releases were being marked as "latest" on GitHub, displacing the actual latest v4.x release
  2. Wheel and attestation artifacts were uploaded to the wrong release (v4.x instead of v3.x)

Changes

1. Added post-release step to un-mark non-main releases as latest

  • Runs gh release edit --latest=false for non-main branch releases
  • Skipped on main (v4.x releases should be latest)
  • GitHub automatically recalculates "latest" to be the highest semver release

2. Pass explicit tag to upload-to-gh-release action

  • Added tag: ${{ steps.release.outputs.tag }} input
  • Prevents the action from auto-detecting the globally highest tag

Root Causes

  • python-semantic-release v10.5.3 doesn't expose a make_latest parameter, so GitHub API defaults to marking every new release as "latest"
  • upload-to-gh-release without explicit tag runs semantic-release internally, finds v4.0.3 as the globally highest tag, and uploads artifacts there

Testing Plan

After merge to main and cherry-pick to v3:

  • Trigger a v3 release (push a fix: commit to v3 branch)
  • Verify v3.x.x release is NOT marked "latest" on GitHub
  • Verify v4.0.3 IS marked "latest"
  • Verify wheel/sdist/sigstore files are attached to v3.x.x release
  • Download from PyPI and verify correct artifacts

Related Issues

Addresses the maintenance branch release issues reported in the initial investigation.

🤖 Generated with Claude Code

Fixes two bugs in the release workflow when deploying from maintenance
branches (e.g. v3):

1. v3 releases were being marked as "latest" on GitHub, displacing the
   actual latest v4.x release. Added a post-release step that uses
   `gh release edit --latest=false` for non-main branches.

2. Wheel and attestation artifacts were uploaded to the wrong release
   (v4.x instead of v3.x). Fixed by passing explicit `tag` input to
   upload-to-gh-release action.

Root causes:
- python-semantic-release v10.5.3 doesn't expose make_latest parameter
- upload-to-gh-release defaults to auto-detecting latest tag globally

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Chris Butler <chris.butler@redhat.com>
@butler54
butler54 requested a review from a team as a code owner May 22, 2026 07:32

@vikas-agarwal76 vikas-agarwal76 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@butler54
butler54 merged commit 6483107 into develop May 22, 2026
18 checks passed
@butler54
butler54 deleted the fix/maintenance-branch-release-latest branch May 22, 2026 07:46
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