Skip to content

Commit 65607f9

Browse files
authored
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
1 parent a1ebdb7 commit 65607f9

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

dist/index.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/platforms/windows/entrypoint.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Get-Process
22

3+
# Copy .upmconfig.toml if it exists
4+
if (Test-Path "C:\githubhome\.upmconfig.toml") {
5+
Write-Host "Copying .upmconfig.toml to $Env:USERPROFILE\.upmconfig.toml"
6+
Copy-Item -Path "C:\githubhome\.upmconfig.toml" -Destination "$Env:USERPROFILE\.upmconfig.toml" -Force
7+
} else {
8+
Write-Host "No .upmconfig.toml found at C:\githubhome"
9+
}
10+
311
# Import any necessary registry keys, ie: location of windows 10 sdk
412
# No guarantee that there will be any necessary registry keys, ie: tvOS
513
Get-ChildItem -Path c:\regkeys -File | ForEach-Object { reg import $_.fullname }

src/model/docker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,25 @@ class Docker {
9292
const {
9393
workspace,
9494
actionFolder,
95+
runnerTempPath,
9596
gitPrivateToken,
9697
dockerWorkspacePath,
9798
dockerCpuLimit,
9899
dockerMemoryLimit,
99100
dockerIsolationMode,
100101
} = parameters;
101102

103+
const githubHome = path.join(runnerTempPath, '_github_home');
104+
if (!existsSync(githubHome)) mkdirSync(githubHome);
105+
102106
return `docker run \
103107
--workdir c:${dockerWorkspacePath} \
104108
--rm \
105109
${ImageEnvironmentFactory.getEnvVarString(parameters)} \
106110
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
107111
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
108112
--volume "${workspace}":"c:${dockerWorkspacePath}" \
113+
--volume "${githubHome}":"C:/githubhome" \
109114
--volume "c:/regkeys":"c:/regkeys" \
110115
--volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \
111116
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \

0 commit comments

Comments
 (0)