venera: add update script

This commit is contained in:
aucub
2024-12-27 12:47:38 +00:00
parent df50ecffea
commit 19eceaac40
2 changed files with 22 additions and 0 deletions
+2
View File
@@ -65,6 +65,8 @@ flutter327.buildFlutterApplication rec {
install -Dm0644 ./debian/gui/venera.png $out/share/pixmaps/venera.png
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Comic reader that support reading local and network comics";
homepage = "https://github.com/venera-app/venera";
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq yq nixVersions.latest bash coreutils nix-update
set -eou pipefail
ROOT="$(dirname "$(readlink -f "$0")")"
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/venera-app/venera/releases/latest | jq --raw-output .tag_name)
latestVersion=$(echo "$latestTag" | sed 's/^v//')
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; venera.version or (lib.getVersion venera)" | tr -d '"')
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "package is up-to-date: $currentVersion"
exit 0
fi
nix-update venera
curl https://raw.githubusercontent.com/venera-app/venera/${latestTag}/pubspec.lock | yq . >$ROOT/pubspec.lock.json