Skip to content

Commit

Permalink
ArchiSteamFarm: 5.4.11.4 -> 5.4.12.3, fix update script for web-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored and yayayayaka committed Oct 21, 2023
1 parent b11e3eb commit c781bd7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions pkgs/applications/misc/ArchiSteamFarm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
buildDotnetModule rec {
pname = "ArchiSteamFarm";
# nixpkgs-update: no auto update
version = "5.4.11.4";
version = "5.4.12.5";

src = fetchFromGitHub {
owner = "JustArchiNET";
repo = "ArchiSteamFarm";
rev = version;
hash = "sha256-wgCpUuJ7Xd+M+YLvywSW/sCQG3SfQtHBX1XJTJVVoI8=";
hash = "sha256-iIYA9BnHUfsB4J7VbSLKaRdJHMW/xULJxKfv8atfAd8=";
};

dotnet-runtime = dotnetCorePackages.aspnetcore_7_0;
Expand Down
5 changes: 5 additions & 0 deletions pkgs/applications/misc/ArchiSteamFarm/deps.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkgs/applications/misc/ArchiSteamFarm/update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq common-updater-scripts nix-prefetch prefetch-npm-deps
#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq common-updater-scripts
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

Expand All @@ -14,13 +14,13 @@ if [[ "$new_version" == "$old_version" ]]; then
fi

asf_path=$PWD
pushd ../../../..
cd ../../../..

if [[ "${1:-}" != "--deps-only" ]]; then
update-source-version ArchiSteamFarm "$new_version"
fi

$(nix-build -A ArchiSteamFarm.fetch-deps --no-out-link)

popd
"$asf_path/web-ui/update.sh"
cd "$asf_path/web-ui"
./update.sh
1 change: 1 addition & 0 deletions pkgs/applications/misc/ArchiSteamFarm/web-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
10 changes: 5 additions & 5 deletions pkgs/applications/misc/ArchiSteamFarm/web-ui/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{ lib, fetchFromGitHub, buildNpmPackage, ArchiSteamFarm }:

buildNpmPackage {
buildNpmPackage rec {
pname = "asf-ui";
inherit (ArchiSteamFarm) version;
version = "fceb2fb828cfa420c77dc5cde433fd519a6717d4";

src = fetchFromGitHub {
owner = "JustArchiNET";
repo = "ASF-ui";
# updated by the update script
# this is always the commit that should be used with asf-ui from the latest asf version
rev = "1d748b6ea01cc2ed7eebb32b4e8f990d8ff5c7d7";
hash = "sha256-fb6fiZOnQeYzasL/NqCtTQTNOhdmIMG0mymaQ9zKQko=";
rev = version;
hash = "sha256-gMQWly7HN5rIV9r72Qa+gHuBuQMs9sh09od4ja4sRGU=";
};

npmDepsHash = "sha256-xbGSmorPytbsjmcGOnGOYXWryMIwCPJ/ksMkSgSfJWY=";
npmDepsHash = "sha256-UDCQTRpcPDcuvPzlqTu315EkGr5G0+z7qMSsPgYQacA=";

installPhase = ''
runHook preInstall
Expand Down
16 changes: 6 additions & 10 deletions pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../../.. -i bash -p nodePackages.node2nix gnused jq curl
#! nix-shell -I nixpkgs=../../../../.. -i bash -p curl gnused jq common-updater-scripts prefetch-npm-deps
set -eou pipefail

cd "$(dirname "$0")"
pushd ../../../../..
cd "$(dirname "$0")"/../../../../..
version=$(nix-instantiate --strict --eval -A ArchiSteamFarm.version | jq -r)
popd
pushd "$(dirname "$0")"
cd -
ui=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/contents/ASF-ui?ref=$version" | jq -r .sha)

curl "https://raw.githubusercontent.com/JustArchiNET/ASF-ui/$ui/package-lock.json" -o package-lock.json

# update-source-version doesn't work for some reason
sed -i "s/rev\\s*=\\s*.*/rev = \"$ui\";/" default.nix
sed -i "s/hash\\s*=\\s*.*/hash = \"$(nix-prefetch fetchurl --url "https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz")\";/" default.nix
cd -
update-source-version ArchiSteamFarm.ui "$ui"
cd -

npmDepsHash=$(prefetch-npm-deps ./package-lock.json)
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'"$npmDepsHash"'"#' -i default.nix

rm package-lock.json

popd

0 comments on commit c781bd7

Please sign in to comment.