Skip to content

Commit 0e22034

Browse files
authored
Merge pull request #3 from Oxen-AI/cleancut/use-latest-runner
Resolve the runner version at boot so Windows runners can register again
2 parents 6865ef6 + 84d98d2 commit 0e22034

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎dist/index.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159662,8 +159662,6 @@ const { EC2Client, RunInstancesCommand, TerminateInstancesCommand, waitUntilInst
159662159662
const core = __webpack_require__(42186);
159663159663
const config = __webpack_require__(34570);
159664159664

159665-
const runnerVersion = '2.309.0'
159666-
159667159665
// User data scripts are run as the root user
159668159666
function buildUserDataScript(githubRegistrationToken, label) {
159669159667
core.info(`Building data script for ${config.input.ec2Os}`)
@@ -159689,8 +159687,10 @@ function buildUserDataScript(githubRegistrationToken, label) {
159689159687
'mkdir C:\\actions-runner; cd C:\\actions-runner',
159690159688
'echo "${config.input.preRunnerScript}" > pre-runner-script.ps1',
159691159689
'& pre-runner-script.ps1',
159692-
`Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v${runnerVersion}/actions-runner-win-x64-${runnerVersion}.zip -OutFile actions-runner-win-x64-${runnerVersion}.zip`,
159693-
`Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-${runnerVersion}.zip", "$PWD")`,
159690+
"$runnerVersion = (Invoke-RestMethod -Uri https://api.github.com/repos/actions/runner/releases/latest).tag_name.TrimStart('v')",
159691+
'$runnerZip = "actions-runner-win-x64-$runnerVersion.zip"',
159692+
'Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/v$runnerVersion/$runnerZip" -OutFile $runnerZip',
159693+
'Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$runnerZip", "$PWD")',
159694159694
`./config.cmd --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name ${label} --unattended`,
159695159695
'./run.cmd',
159696159696
'</powershell>',

‎src/aws.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ const { EC2Client, RunInstancesCommand, TerminateInstancesCommand, waitUntilInst
22
const core = require('@actions/core');
33
const config = require('./config');
44

5-
const runnerVersion = '2.309.0'
6-
75
// User data scripts are run as the root user
86
function buildUserDataScript(githubRegistrationToken, label) {
97
core.info(`Building data script for ${config.input.ec2Os}`)
@@ -29,8 +27,10 @@ function buildUserDataScript(githubRegistrationToken, label) {
2927
'mkdir C:\\actions-runner; cd C:\\actions-runner',
3028
'echo "${config.input.preRunnerScript}" > pre-runner-script.ps1',
3129
'& pre-runner-script.ps1',
32-
`Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v${runnerVersion}/actions-runner-win-x64-${runnerVersion}.zip -OutFile actions-runner-win-x64-${runnerVersion}.zip`,
33-
`Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-${runnerVersion}.zip", "$PWD")`,
30+
"$runnerVersion = (Invoke-RestMethod -Uri https://api.github.com/repos/actions/runner/releases/latest).tag_name.TrimStart('v')",
31+
'$runnerZip = "actions-runner-win-x64-$runnerVersion.zip"',
32+
'Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/v$runnerVersion/$runnerZip" -OutFile $runnerZip',
33+
'Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$runnerZip", "$PWD")',
3434
`./config.cmd --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name ${label} --unattended`,
3535
'./run.cmd',
3636
'</powershell>',

0 commit comments

Comments
 (0)