Merge pull request #167924 from Ma27/bump-wiki-js

wiki-js: add update script, 2.5.276 -> 2.5.277
This commit is contained in:
Maximilian Bosch 2022-04-09 11:40:18 +02:00 committed by GitHub
commit fd364d2688
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "wiki-js";
version = "2.5.276";
version = "2.5.277";
src = fetchurl {
url = "https://github.com/Requarks/wiki/releases/download/v${version}/${pname}.tar.gz";
sha256 = "sha256-ulx3/yj5wxmHsep0+93xpy6VeQJkMXRjGd/xx2F1zII=";
sha256 = "sha256-YLw0DR4dbPfNY56lNybEQFXFEVPZ99sQkwDl6gtz40E=";
};
sourceRoot = ".";
@ -21,7 +21,10 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.tests = { inherit (nixosTests) wiki-js; };
passthru = {
tests = { inherit (nixosTests) wiki-js; };
updateScript = ./update.sh;
};
meta = with lib; {
homepage = "https://js.wiki/";

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion wiki-js" | tr -d '"')"
latestTag="$(git ls-remote --tags --sort="v:refname" https://github.com/Requarks/wiki.git | tail -1 | awk '{ print $2 }' | sed -E "s,^refs/tags/v(.*)$,\1,")"
targetVersion="${1:-$latestTag}"
if [ ! "${oldVersion}" = "${targetVersion}" ]; then
update-source-version wiki-js "${targetVersion}"
nix-build -A wiki-js
else
echo "wiki-js is already up-to-date"
fi