lol

github-runner: 2.307.1 -> 2.308.0

* Update runner to v2.308.0
* Use Node 20 by default
* Allow building with Node 16 support through `nodeRuntimes` argument

It's important to have an easy optin for Node 16 since quite many GitHub
actions (explicitly) rely on Node 16. It probably will take some time
until most switch to Node 20. Note that it's also not an option to tell
those who need Node 16 support to continue to use an older version since
GitHub removes support for previous releases quite quickly.

+24 -7
+24 -7
pkgs/development/tools/continuous-integration/github-runner/default.nix
··· 9 9 , glibcLocales 10 10 , lib 11 11 , nixosTests 12 - , nodejs_16 13 12 , stdenv 14 13 , which 15 14 , buildPackages 16 15 , runtimeShell 16 + # List of Node.js runtimes the package should support 17 + , nodeRuntimes ? [ "node20" ] 18 + , nodejs_16 19 + , nodejs_20 17 20 }: 21 + 22 + # Node.js runtimes supported by upstream 23 + assert builtins.all (x: builtins.elem x [ "node16" "node20" ]) nodeRuntimes; 24 + 18 25 buildDotnetModule rec { 19 26 pname = "github-runner"; 20 - version = "2.307.1"; 27 + version = "2.308.0"; 21 28 22 29 src = fetchFromGitHub { 23 30 owner = "actions"; 24 31 repo = "runner"; 25 32 rev = "v${version}"; 26 - hash = "sha256-h/JcOw7p/loBD6aj7NeZyqK3GtapNkjWTYw0G6OCmVQ="; 33 + hash = "sha256-LrHScQbBkRPSNsfPxvE2+K9tON8xuR0e4JpKVuI+Gu0="; 27 34 leaveDotGit = true; 28 35 postFetch = '' 29 36 git -C $out rev-parse --short HEAD > $out/.git-revision ··· 31 38 ''; 32 39 }; 33 40 34 - # The git commit is read during the build and some tests depends on a git repo to be present 41 + # The git commit is read during the build and some tests depend on a git repo to be present 35 42 # https://github.com/actions/runner/blob/22d1938ac420a4cb9e3255e47a91c2e43c38db29/src/dir.proj#L5 36 43 unpackPhase = '' 37 44 cp -r $src $TMPDIR/src ··· 178 185 ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ 179 186 # "JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Detected Linux Arm64" 180 187 "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNodeRuntimeVersionInAlpineContainerAsync" 188 + "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNode20RuntimeVersionInAlpineContainerAsync" 181 189 ] 182 190 ++ lib.optionals DOTNET_SYSTEM_GLOBALIZATION_INVARIANT [ 183 191 "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" ··· 185 193 "GitHub.Runner.Common.Tests.Worker.VariablesL0.Constructor_SetsOrdinalIgnoreCaseComparer" 186 194 "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchCancellation" 187 195 "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchRunNewJob" 196 + ] 197 + ++ lib.optionals (!lib.elem "node16" nodeRuntimes) [ 198 + "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" 188 199 ]; 189 200 190 201 testProjectFile = [ "src/Test/Test.csproj" ]; 191 202 192 203 preCheck = '' 193 204 mkdir -p _layout/externals 205 + '' + lib.optionalString (lib.elem "node16" nodeRuntimes) '' 194 206 ln -s ${nodejs_16} _layout/externals/node16 207 + '' + lib.optionalString (lib.elem "node20" nodeRuntimes) '' 208 + ln -s ${nodejs_20} _layout/externals/node20 195 209 ''; 196 210 197 211 postInstall = '' ··· 224 238 --replace './externals' "$out/lib/externals" \ 225 239 --replace './bin/RunnerService.js' "$out/lib/github-runner/RunnerService.js" 226 240 227 - # The upstream package includes Node 16 and expects it at the path 228 - # externals/node16. As opposed to the official releases, we don't 241 + # The upstream package includes Node and expects it at the path 242 + # externals/node$version. As opposed to the official releases, we don't 229 243 # link the Alpine Node flavors. 230 244 mkdir -p $out/lib/externals 245 + '' + lib.optionalString (lib.elem "node16" nodeRuntimes) '' 231 246 ln -s ${nodejs_16} $out/lib/externals/node16 232 - 247 + '' + lib.optionalString (lib.elem "node20" nodeRuntimes) '' 248 + ln -s ${nodejs_20} $out/lib/externals/node20 249 + '' + '' 233 250 # Install Nodejs scripts called from workflows 234 251 install -D src/Misc/layoutbin/hashFiles/index.js $out/lib/github-runner/hashFiles/index.js 235 252 mkdir -p $out/lib/github-runner/checkScripts