dotnet: improve language coverage of passthru.tests for dotnet sdks (#370789)
[NixPkgs.git] / pkgs / by-name / mi / mihomo-party / update.sh
blob380b997c25121f3a82a3fc127b4225cbaaca52ad
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
4 latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/mihomo-party-org/mihomo-party/releases/latest | jq -r ".tag_name")
5 latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
6 currentVersion=$(nix-instantiate --eval -E "with import ./. {}; mihomo-party.version" | tr -d '"')
8 echo "latest version: $latestVersion"
9 echo "current version: $currentVersion"
11 if [[ "$latestVersion" == "$currentVersion" ]]; then
12 echo "package is up-to-date"
13 exit 0
16 for i in \
17 "x86_64-linux amd64" \
18 "aarch64-linux arm64"; do
19 set -- $i
20 prefetch=$(nix-prefetch-url "https://github.com/mihomo-party-org/mihomo-party/releases/download/v$latestVersion/mihomo-party-linux-$latestVersion-$2.deb")
21 hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
22 update-source-version mihomo-party $latestVersion $hash --system=$1 --ignore-same-version
23 done