ci: relock uv.lock during release prepare and commit it#9
Merged
Conversation
Prevents the lockfile's own-package version from lagging behind the pyproject version semantic-release bumps (the drift PR #8 cleaned up by hand). Add `uv lock` to the prepare phase between the version `sed` and the build, and include uv.lock in the @semantic-release/git assets so each release commits the aligned lockfile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
semantic-releasebumpspyproject.toml's version but never re-locked, souv.lock's own-package entry drifted behind every release (the lag #8 had to fix by hand).What
In
.releaserc.json:uv lockexec step to the prepare phase, ordered after the versionsedand before the build — so the lockfile reflects the new version, and the built sdist/wheel are consistent with it.uv.lockto the@semantic-release/gitcommit assets, alongsideCHANGELOG.mdandpyproject.toml.Resulting prepare order:
sed(bump version) →uv lock→rm -rf dist && python -m build.uvis already on PATH in the release job (viaastral-sh/setup-uv), so the prepare step runs without extra setup. The relock is a single-line version change resolved from cache.Release impact
Typed
ci:, so semantic-release will not cut a new version on merge (per.releaserc.json). Takes effect on the next real (feat:/fix:) release.🤖 Generated with Claude Code