2023-03-16 21:41:49 +01:00
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl common-updater-scripts nodePackages.node2nix gnused nix coreutils jq
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
latestVersion="$(curl -s "https://api.github.com/repos/mayswind/ariang/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')"
|
|
|
|
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; ariang.version or (lib.getVersion ariang)" | tr -d '"')
|
|
|
|
|
|
|
|
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
|
|
|
echo "ariang is up-to-date: $currentVersion"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-05-05 23:35:37 +02:00
|
|
|
update-source-version ariang 0 sha256-0000000000000000000000000000000000000000000=
|
2023-03-16 21:41:49 +01:00
|
|
|
update-source-version ariang "$latestVersion"
|
|
|
|
|
|
|
|
# use patched source
|
|
|
|
store_src="$(nix-build . -A ariang.src --no-out-link)"
|
|
|
|
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
|
|
|
|
node2nix \
|
2023-05-05 23:35:37 +02:00
|
|
|
--nodejs-18 \
|
2023-03-16 21:41:49 +01:00
|
|
|
--development \
|
|
|
|
--node-env ../../development/node-packages/node-env.nix \
|
|
|
|
--output ./node-deps.nix \
|
|
|
|
--input "$store_src/package.json" \
|
|
|
|
--lock "$store_src/package-lock.json" \
|
2023-05-05 23:35:37 +02:00
|
|
|
--composition ./node-composition.nix
|