ci(windows): enable Developer Mode + system-wide git safe.directory
build-windows / build-windows-x64 (push) Failing after 1h34m10s
build-windows / build-windows-x64 (push) Failing after 1h34m10s
This commit is contained in:
@@ -172,6 +172,22 @@ if (-not (Get-Service -Name 'gitea-act-runner' -ErrorAction SilentlyContinue)) {
|
||||
Start-Service gitea-act-runner
|
||||
Pop-Location
|
||||
|
||||
# --- 8. CI prerequisites that aren't tools, but are environmental switches ---
|
||||
|
||||
# git's "dubious ownership" check (>= 2.35.2) refuses to operate on a repo whose
|
||||
# .git directory is owned by a different user than the one running git.
|
||||
# C:\tools\flutter is provisioned by this script (running as admin) but the
|
||||
# runner service runs as a non-admin user. Trust everything system-wide.
|
||||
git config --system --add safe.directory '*' 2>$null
|
||||
|
||||
# Flutter on Windows needs SeCreateSymbolicLinkPrivilege to build plugins.
|
||||
# Enabling Developer Mode grants this to all non-admin users without per-user
|
||||
# secedit gymnastics.
|
||||
$devKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock'
|
||||
if (-not (Test-Path $devKey)) { New-Item -Path $devKey -Force | Out-Null }
|
||||
New-ItemProperty -Path $devKey -Name 'AllowDevelopmentWithoutDevLicense' `
|
||||
-PropertyType DWORD -Value 1 -Force | Out-Null
|
||||
|
||||
Write-Host ''
|
||||
Write-Host '==> Done. Reboot recommended so PATH/env changes take effect for the runner service.'
|
||||
Write-Host ' After reboot, verify the runner shows up green in Gitea > Site Admin > Actions > Runners.'
|
||||
|
||||
Reference in New Issue
Block a user