Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 17 lines 949 B view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p bash nix curl coreutils common-updater-scripts nix-update jq 3 4currentVersion=$(nix-instantiate --eval -E "with import ./. {}; sparkle.version or (lib.getVersion sparkle)" | tr -d '"') 5latestVersion=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/xishang0128/sparkle/releases/latest | jq --raw-output .tag_name) 6 7echo "latest version: $latestVersion" 8echo "current version: $currentVersion" 9 10if [[ "$latestVersion" == "$currentVersion" ]]; then 11 echo "package is up-to-date" 12 exit 0 13fi 14 15nix-update sparkle --version $latestVersion --system x86_64-linux 16hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; sparkle.src.url" --system aarch64-linux | tr -d '"'))) 17update-source-version sparkle $latestVersion $hash --system=aarch64-linux --ignore-same-version