Skip to content

Commit cd7a41c

Browse files
committed
update-scripts/update: write version-info during update
1 parent 132c161 commit cd7a41c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

update-scripts/update.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,29 @@ writeShellApplication {
4141
fi
4242
}
4343
44+
versionInfo() {
45+
nix-build ./update-scripts -A version-info
46+
install -m 644 -T "$(realpath result)" ./version-info.toml
47+
if [ -n "$commit" ]; then
48+
git add version-info.toml
49+
git commit "$@"
50+
fi
51+
}
52+
53+
# Initialise version-info.toml
54+
if [ ! -f version-info.toml ]; then
55+
echo "Creating version-info file"
56+
versionInfo -m "version-info: init"
57+
fi
58+
4459
# Update the root lockfile
4560
old=$(git show --no-patch --format=%h)
4661
echo "Updating root lockfile"
4762
nix flake update "''${update_args[@]}"
4863
new=$(git show --no-patch --format=%h)
4964
if [ "$old" != "$new" ]; then
65+
echo "Updating version-info"
66+
versionInfo --amend --no-edit
5067
writeGitHubOutput root_lock_body
5168
fi
5269
@@ -59,6 +76,8 @@ writeShellApplication {
5976
--flake './flake/dev'
6077
new=$(git show --no-patch --format=%h)
6178
if [ "$old" != "$new" ]; then
79+
echo "Updating version-info"
80+
versionInfo --amend --no-edit
6281
writeGitHubOutput dev_lock_body
6382
fi
6483
'';

0 commit comments

Comments
 (0)