Skip to content

Commit 1148757

Browse files
authored
ci(release): update uv.lock via workflow instead of release-please (#120)
The release-please generic updater cannot reliably identify the correct version line in uv.lock (too many packages have version fields). Instead, run `uv lock` after release-please creates/updates the PR to regenerate the lockfile with the updated pyproject.toml version. - Remove extra-files config from release-please - Add workflow steps to checkout release branch, run uv lock, and commit
1 parent 05a94b3 commit 1148757

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
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

.release-please-config.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
"include-v-in-tag": true,
99
"packages": {
1010
".": {
11-
"package-name": "stackone-ai",
12-
"extra-files": [
13-
{
14-
"type": "generic",
15-
"path": "uv.lock",
16-
"glob": false
17-
}
18-
]
11+
"package-name": "stackone-ai"
1912
}
2013
},
2114
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"

0 commit comments

Comments
 (0)