Skip to content

Commit 54b4e9f

Browse files
tippmar-nrclaude
andcommitted
ci: use framework-dependent publish to reduce artifact size
Add --no-self-contained to dotnet publish in both the CI pre-publish step and the runtime fallback in RemoteService.PublishWithDotnetExe. Framework-dependent publish is ~5MB vs ~60MB per app since it doesn't bundle the .NET runtime. CI runners have .NET 8 and 10 installed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ea5f355 commit 54b4e9f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/all_solutions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
foreach ($tfm in $tfms) {
255255
if ($tfm -match '^net\d+\.\d+$') {
256256
Write-Host "Pre-publishing $($project.Name) for $tfm/$runtime"
257-
$output = dotnet publish --configuration Release --runtime $runtime --framework $tfm $project.FullName 2>&1
257+
$output = dotnet publish --configuration Release --runtime $runtime --framework $tfm --no-self-contained $project.FullName 2>&1
258258
if ($LASTEXITCODE -ne 0) {
259259
Write-Warning "Failed to pre-publish $($project.Name) for $tfm/$runtime"
260260
$output | Where-Object { $_ -match "error" } | ForEach-Object { Write-Host " $_" }
@@ -360,7 +360,7 @@ jobs:
360360
foreach ($tfm in $tfms) {
361361
if ($tfm -match '^net\d+\.\d+$') {
362362
Write-Host "Pre-publishing $($project.Name) for $tfm/$runtime"
363-
$output = dotnet publish --configuration Release --runtime $runtime --framework $tfm $project.FullName 2>&1
363+
$output = dotnet publish --configuration Release --runtime $runtime --framework $tfm --no-self-contained $project.FullName 2>&1
364364
if ($LASTEXITCODE -ne 0) {
365365
Write-Warning "Failed to pre-publish $($project.Name) for $tfm/$runtime"
366366
$output | Where-Object { $_ -match "error" } | ForEach-Object { Write-Host " $_" }

tests/Agent/IntegrationTests/IntegrationTestHelpers/RemoteServiceFixtures/RemoteService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private void PublishWithDotnetExe(string framework)
126126
WindowStyle = ProcessWindowStyle.Hidden, UseShellExecute = false, FileName = "dotnet",
127127
RedirectStandardOutput = true,
128128
RedirectStandardError = true,
129-
Arguments = $"publish --configuration Release --runtime {runtime} --framework {framework} --output {deployPath} {projectFile}"
129+
Arguments = $"publish --configuration Release --runtime {runtime} --framework {framework} --no-self-contained --output {deployPath} {projectFile}"
130130
};
131131

132132
TestLogger?.WriteLine($"[RemoteService]: executing 'dotnet {startInfo.Arguments}'");

0 commit comments

Comments
 (0)