Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyguard: 1.7.1 -> 1.7.2 #367752

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkgs/by-name/ke/keyguard/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
}:
stdenv.mkDerivation (finalAttrs: {
pname = "keyguard";
version = "1.7.1";
version = "1.7.2";

src = fetchFromGitHub {
owner = "AChep";
repo = "keyguard-app";
tag = "r20241221";
hash = "sha256-AeomyFazONZatbxT6qaTt+/5eBAkgWYwti62CD98jkg=";
tag = "r20241223";
hash = "sha256-7fMSpTKEEjSXfYotZ/qxX1m+i8GheCLboo+XoA3gTbc=";
};

gradleBuildTask = ":desktopApp:createDistributable";
Expand Down Expand Up @@ -60,6 +60,8 @@ stdenv.mkDerivation (finalAttrs: {
useBwrap = false;
};

passthru.updateScript = ./update.sh;

doCheck = false;

gradleFlags = [ "-Dorg.gradle.java.home=${jdk17}" ];
Expand Down
28 changes: 28 additions & 0 deletions pkgs/by-name/ke/keyguard/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need nix latest here?


set -eou pipefail

ROOT="$(dirname "$(readlink -f "$0")")"

latest=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/AChep/keyguard-app/releases/latest)
latestTag=$(echo "$latest" | jq -r ".tag_name")
latestName=$(echo "$latest" | jq -r ".name")
latestVersion=$(echo "$latestName" | awk -F'v|-' '{print $2}')

currentVersion=$(nix-instantiate --eval -E "with import ./. {}; keyguard.version" | tr -d '"')

echo "latest version: $latestVersion"
echo "current version: $currentVersion"

if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi

hash=$(nix hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/AChep/keyguard-app/archive/refs/tags/${latestTag}.tar.gz"))
update-source-version keyguard $latestVersion $hash

sed -i "s/tag = \"r[0-9]\+\";/tag = \"$latestTag\";/g" "$ROOT/package.nix"

$(nix-build -A keyguard.mitmCache.updateScript)
Loading