diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2022-06-06 21:12:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 21:12:45 +0200 |
commit | 81fa70910c2efcef5024bd6a0320bfd68b78c79a (patch) | |
tree | d7112a6cf0662f932f6082cec077b698f149455d | |
parent | 6934c04395e4c9d482e615201ed1a6a54cc7986c (diff) | |
parent | 1235314d6cc0a239eb15061f8c3a9e28b11dbf39 (diff) | |
download | nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar.gz nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar.bz2 nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar.lz nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar.xz nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.tar.zst nixpkgs-81fa70910c2efcef5024bd6a0320bfd68b78c79a.zip |
Merge pull request #176487 from SuperSandro2000/asf-update
-rw-r--r-- | pkgs/applications/misc/ArchiSteamFarm/default.nix | 2 | ||||
-rwxr-xr-x | pkgs/applications/misc/ArchiSteamFarm/update.sh (renamed from pkgs/applications/misc/ArchiSteamFarm/updater.sh) | 19 | ||||
-rwxr-xr-x | pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh | 16 |
3 files changed, 21 insertions, 16 deletions
diff --git a/pkgs/applications/misc/ArchiSteamFarm/default.nix b/pkgs/applications/misc/ArchiSteamFarm/default.nix index 4c0e1d6b730..d9da9e34b73 100644 --- a/pkgs/applications/misc/ArchiSteamFarm/default.nix +++ b/pkgs/applications/misc/ArchiSteamFarm/default.nix @@ -41,7 +41,7 @@ buildDotnetModule rec { ''; passthru = { - updateScript = ./updater.sh; + updateScript = ./update.sh; ui = callPackage ./web-ui { }; }; diff --git a/pkgs/applications/misc/ArchiSteamFarm/updater.sh b/pkgs/applications/misc/ArchiSteamFarm/update.sh index 3c361d70239..4ff04432040 100755 --- a/pkgs/applications/misc/ArchiSteamFarm/updater.sh +++ b/pkgs/applications/misc/ArchiSteamFarm/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -I nixpkgs=../../../.. -i bash -p curl gnused jq common-updater-scripts nuget-to-nix -set -exo pipefail +set -euox pipefail cd "$(dirname "${BASH_SOURCE[0]}")" deps_file="$(realpath ./deps)" @@ -15,15 +15,21 @@ if [[ "$new_version" == "$old_version" ]]; then fi fi +asf_path=$(pwd) cd ../../../.. nixpkgs_path=$(pwd) -if [[ "$1" != "--deps-only" ]]; then +if [[ "${1:-}" != "--deps-only" ]]; then update-source-version ArchiSteamFarm "$new_version" fi store_src="$(nix-build -A ArchiSteamFarm.src --no-out-link)" platforms="$(nix-instantiate --strict --eval --json -A ArchiSteamFarm.meta.platforms | jq -r .[])" src="$(mktemp -d /tmp/ArchiSteamFarm-src.XXX)" + +trap ' + rm -r "$src" +' EXIT + cp -rT "$store_src" "$src" chmod -R +w "$src" @@ -36,15 +42,12 @@ for i in $platforms; do nix-shell -I nixpkgs="$nixpkgs_path" -p dotnet-sdk_6 --argstr system $i --run " mkdir ./nuget_pkgs-$i for project in ArchiSteamFarm/ArchiSteamFarm.csproj ArchiSteamFarm.Tests/ArchiSteamFarm.Tests.csproj; do - dotnet restore $project --packages ./nuget_pkgs-$i + dotnet restore \$project --packages ./nuget_pkgs-$i done; nuget-to-nix ./nuget_pkgs-$i > $deps_file-$i.nix" \ || echo "Did you set up binformat for $i?"; - done; -trap ' - popd - rm -r "$src" -' EXIT +cd "$asf_path" +./web-ui/update.sh diff --git a/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh b/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh index dfe394c7858..90f8baf8e1b 100755 --- a/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh +++ b/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh @@ -1,17 +1,19 @@ #!/usr/bin/env nix-shell -#! nix-shell -i bash -p nodePackages.node2nix gnused jq curl +#! nix-shell -I nixpkgs=../../../.. -i bash -p nodePackages.node2nix gnused jq curl +set -eoux pipefail +pushd ../../../.. version=$(nix-instantiate --strict --eval -A ArchiSteamFarm.version | jq -r) -ui=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/contents/ASF-ui?ref=${version} | jq -r .sha) - -pushd $(dirname "$0") +popd +pushd "$(dirname "$0")" +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 -curl https://raw.githubusercontent.com/JustArchiNET/ASF-ui/${ui}/package.json -o package.json +curl "https://raw.githubusercontent.com/JustArchiNET/ASF-ui/$ui/package-lock.json" -o package-lock.json +curl "https://raw.githubusercontent.com/JustArchiNET/ASF-ui/$ui/package.json" -o package.json # update-source-version doesn't work for some reason sed -i "s/rev\\s*=\\s*.*/rev = \"$ui\";/" default.nix -sed -i "s/sha256\\s*=\\s*.*/sha256 = \"$(nix-prefetch-url --unpack https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz)\";/" default.nix +sed -i "s/sha256\\s*=\\s*.*/sha256 = \"$(nix-prefetch-url --unpack "https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz")\";/" default.nix node2nix \ --nodejs-14 \ |