renode: fix update script

Signed-off-by: Samuel Silva <samuel@ossystems.com.br>
This commit is contained in:
Samuel Silva
2026-03-31 13:02:52 -03:00
parent 9fb89021f0
commit dbb5048e3d
2 changed files with 20 additions and 2 deletions

View File

@@ -11,7 +11,6 @@
gtk3,
lib,
mono,
nix-update-script,
python3Packages,
}:
@@ -180,7 +179,7 @@ buildDotnetModule rec {
executables = [ "Renode" ];
passthru.updateScript = nix-update-script { };
passthru.updateScript = ./update.sh;
meta = {
changelog = "https://github.com/renode/renode/blob/${version}/CHANGELOG.rst";

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts git nix
set -euo pipefail
latest_tag=$(curl -s https://api.github.com/repos/renode/renode/releases/latest | jq -r '.tag_name')
latest_version="${latest_tag#v}"
# Resolve tag to commit hash
# Try dereferenced ref first (annotated tags), then direct ref (lightweight tags)
commit=$(git ls-remote https://github.com/renode/renode "refs/tags/${latest_tag}^{}" | awk '{print $1}')
if [[ -z "$commit" ]]; then
commit=$(git ls-remote https://github.com/renode/renode "refs/tags/${latest_tag}" | awk '{print $1}')
fi
update-source-version renode "$latest_version" --rev="$commit"
# Regenerate nuget deps
$(nix-build -A renode.passthru.fetch-deps --no-out-link)