biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / continuous-integration / github-runner / update.sh
blob26b54bf6ac0ecffd5d24003a2ec7269466556b8f
1 #! /usr/bin/env nix-shell
2 #! nix-shell -I nixpkgs=./. -i bash -p coreutils common-updater-scripts jq curl
4 set -euo pipefail
6 currentVersion="$(nix --extra-experimental-features nix-command eval -f . github-runner.version --raw)"
7 latestVersion="$(curl -s -H "Accept: application/vnd.github.v3+json" \
8 ${GITHUB_TOKEN:+ -H "Authorization: bearer $GITHUB_TOKEN"} \
9 "https://api.github.com/repos/actions/runner/releases/latest" | jq -r ".tag_name")"
10 latestVersion="${latestVersion#?}" # v2.296.2 -> 2.296.2
12 if [[ "$latestVersion" == "$currentVersion" ]]; then
13 echo "github-runner is already up to date: $currentVersion"
14 exit
17 update-source-version github-runner "$latestVersion"
18 $(nix-build -A github-runner.fetch-deps --no-out-link)