ci: add create-release workflow and fix crates.io publish#124
ci: add create-release workflow and fix crates.io publish#124Christiantyemele wants to merge 2 commits into
Conversation
Code Review
|
| Auto-apply | Compact |
|
|
Important
Your trial ends in 3 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.
Was this helpful? React with 👍 / 👎 | Gitar
| VERSION="${{ github.event.inputs.version }}" | ||
| VERSION_NUM="${VERSION#v}" | ||
| echo "Bumping binary version to $VERSION_NUM" | ||
| sed -i "s/^version = \".*\"/version = \"${VERSION_NUM}\"/" binary/Cargo.toml |
There was a problem hiding this comment.
[logic] (confidence: 85%)
The workflow bumps the version in binary/Cargo.toml but does not update Cargo.lock to match. In a Cargo workspace, the lockfile contains the version of each workspace member, so after changing the version in Cargo.toml, Cargo.lock must also be regenerated (e.g., via cargo generate-lockfile). The commit only stages binary/Cargo.toml, leaving Cargo.lock stale with the old version number.
Impact: The tagged commit will have an inconsistent workspace where Cargo.toml says 1.1.6 but Cargo.lock still references the old version. Any subsequent cargo build --locked or cargo check --locked on that commit will fail with a lockfile mismatch error. This also means the repository state on main is inconsistent after the workflow runs, until someone manually regenerates the lockfile.
Evidence:
sed -i "s/^version = \".*\"/version = \"${VERSION_NUM}\"/" binary/Cargo.toml
...
git add binary/Cargo.toml
git commit -m "release: bump version to ${VERSION}"
Suggestion: After the sed command, run cargo generate-lockfile (or cargo check) to update Cargo.lock, then also git add Cargo.lock before committing.
Snif ReviewAdds a manual create-release GitHub Actions workflow that bumps the version in binary/Cargo.toml, commits, tags, and creates a GitHub release; also modifies the existing release workflow to tolerate already-published crates during cargo publish by continuing on failure instead of aborting. Found 1 issue. See inline comments for details. Review detailsChanged files:
Context analyzed: 90 related files (90 via keyword matching). Stats: 155 lines | |
|
Also addresses the review on PR #123 (#123 (comment)): the |
What this adds
1.
create-release.yml— One-click release automationA new GitHub Actions workflow that can be triggered manually from the Actions tab:
v1.1.6)It will automatically:
binary/Cargo.tomlmainv1.1.6)The existing
release.ymlthen picks up the tag and builds binaries for all platforms.2. Fix for
release.yml— crates.io publish toleranceThe
publish-cratesjob now loops through crates and continues on failure instead of crashing the entire release when a crate already exists on crates.io. This was the error that blocked the v0.1.6 release pipeline:cargo publish -p pocketflow-core --token *** → error: crate pocketflow-core@0.1.0 already exists