technitium-dns-server{,-library}: add update script (#536057)

This commit is contained in:
Sandro
2026-07-18 18:07:12 +00:00
committed by GitHub
3 changed files with 20 additions and 5 deletions

View File

@@ -3,7 +3,6 @@
buildDotnetModule,
fetchFromGitHub,
dotnetCorePackages,
nix-update-script,
}:
buildDotnetModule rec {
pname = "technitium-dns-server-library";
@@ -27,8 +26,6 @@ buildDotnetModule rec {
"TechnitiumLibrary.Security.OTP/TechnitiumLibrary.Security.OTP.csproj"
];
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/TechnitiumSoftware/DnsServer/blob/master/CHANGELOG.md";
description = "Library for Authorative and Recursive DNS server for Privacy and Security";

View File

@@ -6,7 +6,6 @@
technitium-dns-server-library,
libmsquic,
nixosTests,
nix-update-script,
}:
buildDotnetModule rec {
pname = "technitium-dns-server";
@@ -45,7 +44,7 @@ buildDotnetModule rec {
inherit (nixosTests) technitium-dns-server;
};
passthru.updateScript = nix-update-script { };
passthru.updateScript = ./update.sh;
meta = {
changelog = "https://github.com/TechnitiumSoftware/DnsServer/blob/master/CHANGELOG.md";

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts gnused nix coreutils
set -euo pipefail
latestVersion="$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/TechnitiumSoftware/DnsServer/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')"
currentVersion="${UPDATE_NIX_OLD_VERSION:-$(nix-instantiate --eval -E 'with import ./. {}; technitium-dns-server.version or (lib.getVersion technitium-dns-server)' | tr -d '"')}"
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "technitium-dns-server is up-to-date: $currentVersion"
exit 0
fi
update-source-version technitium-dns-server-library "$latestVersion"
update-source-version technitium-dns-server "$latestVersion"
# Regenerate nuget dependencies for both packages
$(nix-build . -A technitium-dns-server-library.fetch-deps --no-out-link)
$(nix-build . -A technitium-dns-server.fetch-deps --no-out-link)