Merged
Conversation
Prevent publishing versions that are equal to or lower than current crates.io version. Changes: - Add version check step that fetches current version from crates.io API - Compare local tag version with crates.io version using semver sort - Skip publish steps if version is equal or lower - Fail workflow if attempting to publish older version - Support first-time publish when crate not found on crates.io Version comparison logic: - Uses crates.io API endpoint to fetch max_version - Implements semver comparison via sort -V - Sets should_publish output variable for conditional execution - All publish steps now conditional on version check result Benefits: - Prevents duplicate version publish errors - Clear feedback on version conflicts - Automatic skip for already-published versions - Better developer experience with explicit version messages
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
Replace sort -V with proper semver comparison using Rust semver crate. Changes: - Create temporary Rust project with semver dependency - Use semver::Version::parse() for accurate version comparison - Handle prerelease versions correctly (1.0.0 > 1.0.0-alpha) - Proper comparison for all semver scenarios Fixes: - P1 issue: sort -V incorrectly orders prerelease versions - Now correctly handles: stable vs prerelease, prerelease ordering - Prevents publishing older versions in all cases Testing: - 1.0.0 > 1.0.0-alpha ✓ - 1.0.0-beta > 1.0.0-alpha ✓ - 0.24.19 > 0.24.18 ✓
Owner
Author
|
Fixed in commit f048f5a. Replaced
Correctly handles:
Tested scenarios: This eliminates the prerelease ordering issues mentioned in the P1 review. |
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.
Summary
Added automated version comparison with crates.io to prevent publishing duplicate or older versions. The release workflow now checks if the local version is higher than the current crates.io version before attempting to publish.
Changes
Version Check Step
/api/v1/crates/{crate}/)sort -V)should_publishoutput variable for conditional executionConditional Publishing
should_publish == 'true'Version Comparison Logic
Benefits
Test Plan
Testing Scenarios
Next Steps
Workflow will be tested on next actual release tag push.
Closes #193