Skip to content

fix(ci): keep Cargo.lock in step with the released version - #6

Merged
MihaiNueleanu merged 1 commit into
mainfrom
fix/cargo-lock-version
Oct 30, 2026
Merged

MihaiNueleanu merged 1 commit into
mainfrom
fix/cargo-lock-version

Conversation

@MihaiNueleanu

Copy link
Copy Markdown
Contributor

Clippy on main dies before it compiles anything:

error: cannot update the lock file .../Cargo.lock because --locked was passed to prevent this

Cause: the publish job bumps Cargo.toml to the new version, commits it, and never regenerates Cargo.lock. The lock records the workspace package's own version, so after the v0.2.0 release the lock still said version = "0.1.0" for kubetitan, and every --locked invocation since (clippy, tests) fails with that message. The [skip ci] on the bump commit is why nothing caught it at the time.

Fix:

  • Cargo.lock: kubetitan 0.1.0 -> 0.2.0, so main is green again.
  • release.yaml: install the pinned Rust toolchain in publish and run cargo update --workspace right after the version sed. --workspace re-resolves members only, so the diff is that one version line and no dependency moves.

Checked locally: cargo update --workspace changes exactly one line; cargo clippy --all-targets --locked -- -D warnings exits 0; cargo test --locked 51 passed.

The publish job bumped Cargo.toml to 0.2.0, committed it, and left Cargo.lock
recording 0.1.0, because nothing regenerated the lock. The next --locked check
then died with 'cannot update the lock file ... because --locked was passed'.

- Cargo.lock carries the workspace version now (0.2.0), which fixes main.
- The publish job runs 'cargo update --workspace' after the sed, with the
  pinned toolchain installed, so the next bump cannot drift again.
@MihaiNueleanu
MihaiNueleanu merged commit ae51711 into main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant