Skip to content

Commit

Permalink
Workaround sdk quirks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcschier committed Jan 16, 2025
1 parent 53895c3 commit a0b3e17
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if (![string]::IsNullOrWhiteSpace($script:ContainerRegistry)) {
$namespace = $namespace.Replace("_", "/")
$imageNamespace = $namespace.Substring(0, [Math]::Min($namespace.Length, 24))
}
}
}
}

$env:DOTNET_CONTAINER_REGISTRY_CHUNKED_UPLOAD = $true
Expand Down Expand Up @@ -133,7 +133,7 @@ Get-ChildItem $Path -Filter *.csproj -Recurse | ForEach-Object {

if (![string]::IsNullOrWhiteSpace($script:TarFileOutput)) {
Write-Host "Publish as tarball to $($script:TarFileOutput)/$($fullName).tar.gz..."
$extra += "/p:ContainerArchiveOutputPath=$($script:TarFileOutput)/$($fullName).tar.gz"
$extra += "/p:ContainerArchiveOutputPath=$($script:TarFileOutput)"
}
elseif ($script:ContainerRegistry) {
Write-Host "Publish to container registry $($script:ContainerRegistry)..."
Expand All @@ -142,15 +142,18 @@ Get-ChildItem $Path -Filter *.csproj -Recurse | ForEach-Object {

dotnet publish $projFile.FullName -c $configuration --self-contained false --no-build `
-r $runtimeId /p:TargetLatestRuntimePatch=true `
/p:RuntimeIdentifiers= `
/p:RuntimeIdentifiers=$runtimeId `
/p:ContainerBaseImage=$baseImage `
/p:ContainerRepository=$($fullName) `
/p:ContainerImageTag=$($fullTag) `
$extra /t:PublishContainer
if ($LastExitCode -ne 0) {
throw "Failed to publish container."
}

Write-Host "$($fullName):$($fullTag) published."
}
}

# The tar.gz was published as $($fullName)-$runtimeId.tar.gz, let's rename them
Get-ChildItem -Filter "*.tar.gz" -Path $script:TarFileOutput -Recurse `
| Rename-Item -NewName {$_.Name -replace "-$($runtimeId)", "" }

0 comments on commit a0b3e17

Please sign in to comment.