Self-Hosted GitHub Runners (Windows)
Step-by-step guide for provisioning a Windows 10/11 (x64) machine as a self-hosted GitHub Actions runner for the Ever Gauzy project.
Runner version: 2.331.0 (update the version and checksum below as needed) Estimated time: ~1β2 hours (Visual Studio Build Tools takes the longest)
Prerequisitesβ
- A fresh or clean Windows 10/11 machine with administrator access
- Internet connectivity
- A GitHub organization runner registration token β see Adding self-hosted runners
All commands in this guide must be run in an elevated (Administrator) PowerShell terminal.
Step 1 β Install the GitHub Actions Runnerβ
mkdir C:\actions-runner; cd C:\actions-runner
# Download the runner
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.331.0/actions-runner-win-x64-2.331.0.zip -OutFile actions-runner-win-x64-2.331.0.zip
# Verify checksum
if ((Get-FileHash -Path actions-runner-win-x64-2.331.0.zip -Algorithm SHA256).Hash.ToUpper() -ne '473e74b86cd826e073f1c1f2c004d3fb9e6c9665d0d51710a23e5084a601c78a'.ToUpper()) {
throw 'Computed checksum did not match'
}
# Extract
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\actions-runner-win-x64-2.331.0.zip", "$PWD")
Step 2 β Configure the Runnerβ
# Replace YOUR_TOKEN with the registration token from GitHub
./config.cmd --url https://github.com/ever-co --token YOUR_TOKEN
Get a token from GitHub β Organization Settings β Actions β Runners β New self-hosted runner. Tokens are short-lived, so generate one right before running this command.
Step 3 β Enable Long Path Supportβ
Windows has a 260-character path limit by default, which breaks many Node.js projects.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
A reboot is required for this change to take full effect.
Step 4 β Install Chocolateyβ
Chocolatey is used as the primary package manager for the remaining tools.
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Refresh PATH so choco is available
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
Step 5 β Install Build Tools and Dependenciesβ
5a. Visual Studio 2022 Build Toolsβ
Required for compiling native Node.js modules (node-gyp, etc.). This step takes ~20β60 minutes.
choco install -y visualstudio2022buildtools --execution-timeout=21600 --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive --norestart"
5b. Git, Python, Node.js, Yarn, and NSISβ
choco install -y git --params "/GitAndUnixToolsOnPATH"
choco install -y python3 --params "/InstallDir:C:\Python"
choco install -y nodejs-lts
choco install -y yarn
choco install -y nsis
5c. Refresh PATH and Verifyβ
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
Write-Host "=== Verification ===" -ForegroundColor Cyan
@("git","bash","node","npm","yarn","python","pip","makensis") | ForEach-Object {
$cmd = Get-Command $_ -ErrorAction SilentlyContinue
if ($cmd) { Write-Host " OK $_ : $($cmd.Source)" -ForegroundColor Green }
else { Write-Host " MISSING $_ : NOT FOUND" -ForegroundColor Red }
}
Step 6 β Create python3 Aliasβ
Some build scripts expect python3 to exist on Windows. Create a copy next to python.exe:
$pythonPath = (Get-Command python.exe -ErrorAction SilentlyContinue).Source
if ($pythonPath) {
$dir = Split-Path $pythonPath -Parent
Copy-Item $pythonPath (Join-Path $dir "python3.exe") -Force
Write-Host "Created python3.exe at $dir" -ForegroundColor Green
} else {
Write-Host "Python not found - check Step 5b" -ForegroundColor Red
}
Verify both work:
python --version
python3 --version
Step 7 β Configure Git for Long Pathsβ
git config --system core.longpaths true
Step 8 β Enable Developer Modeβ
Required for symlink support without elevation (used by some Node.js tooling):
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
Step 9 β Set Execution Policyβ
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
Step 10 β Performance Tuningβ
10a. Add Antivirus Exclusionsβ
This significantly speeds up builds by skipping real-time scanning of the runner workspace and common build processes:
Add-MpPreference -ExclusionPath "C:\actions-runner"
Add-MpPreference -ExclusionProcess "node.exe"
Add-MpPreference -ExclusionProcess "pwsh.exe"
10b. Disable Windows Search Indexingβ
The WSearch service wastes I/O on a dedicated build machine:
Stop-Service -Name "WSearch" -Force
Set-Service -Name "WSearch" -StartupType Disabled
Step 11 β Restart the Runner Serviceβ
After all installations, restart the runner so it picks up the updated PATH and environment:
Restart-Service actions.runner.ever-co.* -Force
Write-Host "Runner service restarted." -ForegroundColor Green
Replace ever-co with your organization name if different.