Skip to content

Commit 7f10eaf

Browse files
ci: add uv.lock sync practices to GitHub workflows (#48)
* Initial plan * Add uv.lock sync practices to GitHub workflows - ci.yml: Use `uv sync --locked` to catch lockfile drift - publish-to-pypi.yml: Use `uv build --no-sources` to validate metadata - release.yml: Auto-update uv.lock on release-please PRs Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com> * chore: update uv.lock to match pyproject.toml version 0.4.0 Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
1 parent f44f88f commit 7f10eaf

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
1717
with:
1818
python-version: "3.13"
19-
- run: uv sync --all-extras --dev
19+
- run: uv sync --locked --all-extras --dev
2020
- name: Lint
2121
run: uv run ruff check .
2222
- name: Format check

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
print(tomllib.load(f)['project']['version'])
3333
")
3434
sed -i "s/^version = \".*\"/version = \"${CURRENT_VERSION}.dev${GITHUB_RUN_NUMBER}\"/" pyproject.toml
35-
- run: uv build
35+
- run: uv build --no-sources
3636
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3737
with:
3838
name: python-package-distributions

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,25 @@ jobs:
2323
with:
2424
release-type: python
2525
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
27+
if: steps.release.outputs.pr && !steps.release.outputs.release_created
28+
with:
29+
ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
30+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
31+
- uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7
32+
if: steps.release.outputs.pr && !steps.release.outputs.release_created
33+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
34+
if: steps.release.outputs.pr && !steps.release.outputs.release_created
35+
with:
36+
python-version: "3.13"
37+
- name: Update uv.lock
38+
if: steps.release.outputs.pr && !steps.release.outputs.release_created
39+
run: |
40+
uv lock
41+
if [ -n "$(git status --porcelain uv.lock)" ]; then
42+
git config user.name "github-actions[bot]"
43+
git config user.email "github-actions[bot]@users.noreply.github.com"
44+
git add uv.lock
45+
git commit -m "chore: update uv.lock for release"
46+
git push
47+
fi

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)