mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
technitium-dns-server{,-library}: add update script (#536057)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
19
pkgs/by-name/te/technitium-dns-server/update.sh
Executable file
19
pkgs/by-name/te/technitium-dns-server/update.sh
Executable 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)
|
||||
Reference in New Issue
Block a user