ci(release): handle already-published error for cargo publish idempotency#19
Merged
Merged
Conversation
…ency When a release workflow is re-triggered after a previous successful crates.io publish (e.g. to rebuild macOS binaries), the publish step fails with 'already exists on crates.io index' (exit 101), marking the entire workflow as failed even though the crate is correctly published. Fix: pipe cargo publish output and treat 'already exists' as success. Any other cargo publish failure still propagates as a real error. Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.
Problem
When release workflow is re-triggered after a successful crates.io publish (e.g. to rebuild macOS binaries), cargo publish fails with 'already exists on crates.io index', marking the entire workflow as failed even though the crate is correctly published.
Root cause: v0.5.0 was published in run 23755682096, then re-triggered as run 23760307159 which hit the error.
Fix
Pipe cargo publish output and treat 'already exists' as a no-op. Any other failure still propagates as a real error.
Test
CI should pass (workflow-only change, no Rust compilation).