{ bash, buildDotnetModule, coreutils, darwin, dotnetCorePackages, fetchFromGitHub, fetchpatch, gitMinimal, glibc, glibcLocales, lib, nixosTests, stdenv, which, buildPackages, runtimeShell, # List of Node.js runtimes the package should support nodeRuntimes ? [ "node20" "node24" ], nodejs_20, nodejs_24, }: # Node.js runtimes supported by upstream assert builtins.all ( x: builtins.elem x [ "node20" "node24" ] ) nodeRuntimes; buildDotnetModule (finalAttrs: { pname = "github-runner"; version = "2.328.0"; src = fetchFromGitHub { owner = "actions"; repo = "runner"; tag = "v${finalAttrs.version}"; hash = "sha256-3Q2bscLKdUBPx+5X0qxwtcy3CU6N/wE8yO1CcATSyBQ="; leaveDotGit = true; postFetch = '' git -C $out rev-parse --short HEAD > $out/.git-revision rm -rf $out/.git ''; }; # The git commit is read during the build and some tests depend on a git repo to be present # https://github.com/actions/runner/blob/22d1938ac420a4cb9e3255e47a91c2e43c38db29/src/dir.proj#L5 unpackPhase = '' cp -r $src $TMPDIR/src chmod -R +w $TMPDIR/src cd $TMPDIR/src ( export PATH=${buildPackages.git}/bin:$PATH git init git config user.email "root@localhost" git config user.name "root" git add . git commit -m "Initial commit" git checkout -b v${finalAttrs.version} ) mkdir -p $TMPDIR/bin cat > $TMPDIR/bin/git </dev/null $out/bin/Runner.Listener --help >/dev/null version=$($out/bin/Runner.Listener --version) if [[ "$version" != "${finalAttrs.version}" ]]; then printf 'Unexpected version %s' "$version" exit 1 fi commit=$($out/bin/Runner.Listener --commit) if [[ "$commit" != "$(git rev-parse HEAD)" ]]; then printf 'Unexpected commit %s' "$commit" exit 1 fi runHook postInstallCheck ''; passthru = { tests.smoke-test = nixosTests.github-runner; updateScript = ./update.sh; }; meta = { changelog = "https://github.com/actions/runner/releases/tag/v${finalAttrs.version}"; description = "Self-hosted runner for GitHub Actions"; homepage = "https://github.com/actions/runner"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ veehaitch kfollesdal aanderse zimbatm ]; platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; })