nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
3
4set -eou pipefail
5
6latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/wavetermdev/waveterm/releases/latest | jq -r ".tag_name")
7latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
8currentVersion=$(nix-instantiate --eval -E "with import ./. {}; waveterm.version" | tr -d '"')
9
10echo "latest version: $latestVersion"
11echo "current version: $currentVersion"
12
13if [[ "$latestVersion" == "$currentVersion" ]]; then
14 echo "package is up-to-date"
15 exit 0
16fi
17
18for i in \
19 "x86_64-linux amd64" \
20 "aarch64-linux arm64"; do
21 set -- $i
22 prefetch=$(nix-prefetch-url "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/waveterm-linux-$2-$latestVersion.deb")
23 hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
24 update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
25done
26
27for i in \
28 "x86_64-darwin x64" \
29 "aarch64-darwin arm64"; do
30 set -- $i
31 prefetch=$(nix-prefetch-url "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/Wave-darwin-$2-$latestVersion.zip")
32 hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
33 update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
34done