2021-12-06 16:07:01 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2022-09-14 18:05:37 +00:00
|
|
|
#!nix-shell -I nixpkgs=../../../.. -i bash -p curl gnused jq common-updater-scripts
|
|
|
|
set -euo pipefail
|
2021-12-06 16:07:01 +00:00
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
deps_file="$(realpath ./deps.nix)"
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
new_version="$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} -s "https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/releases" | jq -r 'map(select(.prerelease == false)) | .[0].tag_name')"
|
|
|
|
old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
|
|
|
|
|
|
|
|
if [[ "$new_version" == "$old_version" ]]; then
|
|
|
|
echo "Already up to date!"
|
2022-09-14 18:05:37 +00:00
|
|
|
if [[ "${1-default}" != "--deps-only" ]]; then
|
2022-06-16 17:23:12 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
2021-12-06 16:07:01 +00:00
|
|
|
fi
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
asf_path=$(pwd)
|
2021-12-06 16:07:01 +00:00
|
|
|
cd ../../../..
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
nixpkgs_path=$(pwd)
|
|
|
|
if [[ "${1:-}" != "--deps-only" ]]; then
|
|
|
|
update-source-version ArchiSteamFarm "$new_version"
|
|
|
|
fi
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
$(nix-build -A ArchiSteamFarm.fetch-deps --no-out-link) "$deps_file"
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
cd "$asf_path"
|
|
|
|
./web-ui/update.sh
|