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"
17 "x86_64-linux amd64" \
18 "aarch64-linux arm64"; do
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