-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Objective
Add automated version comparison to prevent publishing versions that are equal to or lower than the current version on crates.io.
Current Behavior
Release workflow publishes to crates.io when a tag v* is pushed, checking only that the tag matches Cargo.toml version. This can lead to:
- Attempting to publish the same version twice (fails with cryptic error)
- Accidentally pushing an older version
- No clear feedback about version conflicts
Desired Behavior
Before attempting to publish:
- Fetch current version from crates.io API
- Compare with tag version
- If tag version > crates.io version: proceed with publish
- If tag version <= crates.io version: skip publish with clear message
Implementation
- Use crates.io API to fetch current max_version
- Implement semver comparison (handle major.minor.patch)
- Add check step after "Ensure tag matches Cargo.toml version"
- Provide clear output messages for each scenario
Benefits
- Prevents publishing errors
- Clear feedback on version conflicts
- Automatic skip for already-published versions
- Better developer experience
Metadata
Metadata
Assignees
Labels
No labels