From 65607f9ebb93ad06fb93ee4d3bd3d851a81bd319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lupia=C3=B1ez=20Casares?= Date: Sat, 7 Jun 2025 23:11:18 +0200 Subject: [PATCH] Adds support for .upmconfig.toml in Windows Docker images (#705) * Supports github_home in windows-latest * Attempt at copying from specific volume * Adding some more logging * Fix and compiles index.js * Debugging and some other approach * Another attempt at debugging * Testing two more approaches * Try only copying the file * Cleanup * Updates index.js, index.js.map and licenses.txt After `yarn` + `npm run build` * Update index.js.map --- dist/index.js | Bin 15273650 -> 15273908 bytes dist/index.js.map | Bin 16975660 -> 16975947 bytes dist/platforms/windows/entrypoint.ps1 | 8 ++++++++ src/model/docker.ts | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/dist/index.js b/dist/index.js index 591c3043c457c00ec5342fb4f1adc6b40fca23e7..d9ffab465aaa2ee07fae6732c97d6be629f71ad0 100644 GIT binary patch delta 1008 zcmXBMS9^{J0D$33y`*UDRYZx{jUb7UNbK5_8m*d9Bxa46)dsPZ((<*o3bjWX4Pw-e z+M3$4=Ff1u9NZ_*!IQl)D=cSoR#--6q0A353+Dv+twPgcgVLeBu|bzmnWP{(6do7k zh4v*D4GX=B52A9@l7g{?BBExGPMeyVp3-^Z_>prW6C&Fu#JmrwLg;4epvt0xl^{;2TCViqWK!#u&yjj`2)jBHuEJ$xLA?=}cof zGnmONX7e3$_?{ogU@r5RPbLdk$RZZAgrzKFIX|+3mHfmiR`WBzu!gmS_?6#S$9guf zkxgu73tRb}ZDg^X9sI#gcCnj1>}4POIlw^H>Wwn zSxSu5guWT;~Qixy8Q}@E^Ci!(Hxip9ehT5s!JoQ=aiZ&w0U1Uhz7& KAou&+O3HWsY delta 953 zcmWN=gLV}F007Way;{q*mbJ88+p=xjwz2AEYfEck*|l1>&1Lg5y7!!$l#m#5IzBNZ zCYUOiI+!LYaKC=s(TG6HxUk4Tcyee|AU4&~l<0tIO=pPd4K;%q&17b?nAL1%H-|aR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%Q^nx{H$mqGMC8aXrfporRTrkuKYIu delta 1089 zcmWl~XP6EI007|UqujZ0GBYy1_JI!pGC3?QI3hV`Usg!+ z*3@9di~;Gv*g!%=W{}6Iz~fXTf=X28393+)YE-8NPx2HssYPw-P?vhtrvVLlnnpC{ z8Jh4cO=(6X&1pePTG5&|Jje626C0?czoq2^Wbfp{J>A|b?q!+L8 zI=$(`8}#K(`tcV18Nl1T!$1ZR!(fImlwk~K1S1*6Xx?QE?-9#b;uy#K#50}=OeBFx zOlAsGNn{$+nZZnEF`FdjFqaQVW*+ldz(PLcBR=L6KIJn$XAz58!cvy8oE5BO6)B|h z1*=)ZTGp|iFG(Yv3^MtOui3yxHt`Kve9L!iW((i*13$8rpZJ+=Y-a~M`GsBV=2!Nx zm*4oEKiJ294seh^ImBNa<_JeQ#&J&YH~(;wQ=H}uXF11tE^v`cT;>W_xyE&FaFc(z c#ci^=!+-qGU2>*IWCmss$co6!6{rw>52@?>{Qv*} diff --git a/dist/platforms/windows/entrypoint.ps1 b/dist/platforms/windows/entrypoint.ps1 index 81d2bf0c..0868015d 100644 --- a/dist/platforms/windows/entrypoint.ps1 +++ b/dist/platforms/windows/entrypoint.ps1 @@ -1,5 +1,13 @@ Get-Process +# Copy .upmconfig.toml if it exists +if (Test-Path "C:\githubhome\.upmconfig.toml") { + Write-Host "Copying .upmconfig.toml to $Env:USERPROFILE\.upmconfig.toml" + Copy-Item -Path "C:\githubhome\.upmconfig.toml" -Destination "$Env:USERPROFILE\.upmconfig.toml" -Force +} else { + Write-Host "No .upmconfig.toml found at C:\githubhome" +} + # Import any necessary registry keys, ie: location of windows 10 sdk # No guarantee that there will be any necessary registry keys, ie: tvOS Get-ChildItem -Path c:\regkeys -File | ForEach-Object { reg import $_.fullname } diff --git a/src/model/docker.ts b/src/model/docker.ts index 544540f7..8820fbbe 100644 --- a/src/model/docker.ts +++ b/src/model/docker.ts @@ -92,6 +92,7 @@ class Docker { const { workspace, actionFolder, + runnerTempPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, @@ -99,6 +100,9 @@ class Docker { dockerIsolationMode, } = parameters; + const githubHome = path.join(runnerTempPath, '_github_home'); + if (!existsSync(githubHome)) mkdirSync(githubHome); + return `docker run \ --workdir c:${dockerWorkspacePath} \ --rm \ @@ -106,6 +110,7 @@ class Docker { --env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \ ${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \ --volume "${workspace}":"c:${dockerWorkspacePath}" \ + --volume "${githubHome}":"C:/githubhome" \ --volume "c:/regkeys":"c:/regkeys" \ --volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \ --volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \