#!/usr/bin/env bash # Install or update the GitHub Actions runner in ~/actions-runner, for # copying into one sandbox per job. From https://exe.dev/deploy/github-actions. # It doesn't register the runner: the dispatcher registers each copy itself. set -euo pipefail rel=$(curl -fsSL https://api.github.com/repos/actions/runner/releases/latest) version=$(jq -r .tag_name <<<"$rel") sha=$(jq -r .body <<<"$rel" | sed -n 's/.*\([0-9a-f]\{64\}\).*/\1/p') tarball=actions-runner-linux-x64-${version#v}.tar.gz rm -rf ~/actions-runner && mkdir -p ~/actions-runner && cd ~/actions-runner curl -fsSL -o "$tarball" "https://github.com/actions/runner/releases/download/$version/$tarball" echo "$sha $tarball" | sha256sum -c - tar xzf "$tarball" && rm "$tarball" sudo ./bin/installdependencies.sh >/tmp/runner-deps.log 2>&1 || { cat /tmp/runner-deps.log; exit 1; } # Containers in jobs: start Docker with the VM rather than on first use. sudo systemctl enable --now docker.service >/dev/null 2>&1 sync echo "runner $version installed in ~/actions-runner"