Skip to content

Commit e63cf06

Browse files
committed
fix(release): update uv.lock in release PR
Instead of using release-please's generic updater (which cannot reliably identify the correct version line in uv.lock), update uv.lock via workflow after release-please creates/updates the PR. - Remove extra-files config from release-please (doesn't work for uv.lock) - Add workflow step to run uv lock and commit to release PR branch - Use skip-uv-sync for release steps since nix develop handles deps
1 parent 893ed42 commit e63cf06

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,33 @@ jobs:
1919
config-file: .release-please-config.json
2020
manifest-file: .release-please-manifest.json
2121

22+
# Update uv.lock when release PR is created/updated
23+
- name: Checkout repository (for PR update)
24+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
25+
if: ${{ steps.release.outputs.pr }}
26+
with:
27+
ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
28+
29+
- name: Setup Nix (for PR update)
30+
if: ${{ steps.release.outputs.pr }}
31+
uses: ./.github/actions/setup-nix
32+
with:
33+
skip-uv-sync: "true"
34+
35+
- name: Update uv.lock
36+
if: ${{ steps.release.outputs.pr }}
37+
run: |
38+
nix develop --command uv lock
39+
if git diff --quiet uv.lock; then
40+
echo "uv.lock is already up to date"
41+
else
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"
46+
git push
47+
fi
48+
2249
# Only release to PyPI when a new release is created
2350
- name: Checkout repository
2451
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -28,7 +55,7 @@ jobs:
2855
if: ${{ steps.release.outputs.release_created }}
2956
uses: ./.github/actions/setup-nix
3057
with:
31-
skip-mock-server: "true"
58+
skip-uv-sync: "true"
3259

3360
- name: Update version in __init__.py
3461
if: ${{ steps.release.outputs.release_created }}

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)