Override release_command from cargo dist to prevent automatic latest#186
Merged
GuillaumeLagrange merged 1 commit intomainfrom Jan 6, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR overrides cargo-dist's default release command to prevent GitHub from automatically marking releases as "latest" when they are undrafted. The change works around a cargo-dist limitation by manually editing the generated CI workflow to use the GitHub API directly instead of gh release edit, which cannot properly suppress the automatic "latest" marking.
Key Changes:
- Added
allow-dirty = ["ci"]configuration to dist-workspace.toml to allow manual edits to generated CI files - Replaced
gh release editcommand with direct GitHub API calls to control the "latest" flag behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dist-workspace.toml | Adds allow-dirty configuration with documentation explaining the need for manual CI edits due to cargo-dist limitations |
| .github/workflows/release.yml | Replaces the gh release edit command with GitHub API calls to set draft=false without marking as latest |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #186 will not alter performanceComparing Summary
|
…latest `gh release edit` behavior marks the release as latest even with `gh release edit --latest=false --draft=false` Doing this via `gh api` results in the desired behavior. The release will be marked as latest by the post-announce custom job if necessary.
a4ca8a9 to
8bb51c1
Compare
art049
approved these changes
Jan 6, 2026
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.
Testing showed that
will automatically mark the release as latest
this is also true if we explicitly do
gh release edit v1.0.1 --draft=false --latest=falseWe have two issues here
gh apiin order to preventgh release edittrying to me too smart for its own good.The release is then marked as latest as part of the post-announce workflow if we have released a non pre release runner version.
Tested here: https://github.com/CodSpeedHQ/runner/actions/runs/20745672268/job/59562574430#step:10:8
The alpha release is cleaned up already, but I can do further testing if necessary