Skip to content

Commit 5689f36

Browse files
Update nupkg creation (#196)
* Use subdirectory 'packages' for generated nupkg * Append Configuration to pkg name for Debug configuration
1 parent 772f6be commit 5689f36

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Diff for: scripts/onebranch/post-build.ps1

+9-11
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ Set-Location $scriptPath\..\..
5757
$SolutionDir = Get-Location
5858
msbuild /p:SolutionDir=$SolutionDir\ /p:Configuration=$OneBranchConfig /p:Platform=$OneBranchArch /p:BuildProjectReferences=false .\tools\nuget\nuget.proj /t:Restore,Build,Pack
5959

60-
# Copy the nupkg and msi to the output directory
61-
if ($OneBranchConfig -eq "Debug" -and $OneBranchArch -eq "x64") {
62-
xcopy /y .\x64\Debug\*.nupkg .\build\bin\x64_Debug
63-
Copy-BuildFolder -Configuration Debug -Arch x64
64-
}
65-
elseif ($OneBranchConfig -eq "Release" -and $OneBranchArch -eq "x64") {
66-
xcopy /y .\x64\Release\*.nupkg .\build\bin\x64_Release
67-
Copy-BuildFolder -Configuration Release -Arch x64
60+
$SourceNupkgPath = ".\$OneBranchArch\$OneBranchConfig\*.nupkg"
61+
# Copy the nupkg to the 'packages' subdirectory in the output directory (default used by onebranch pipelines to publish nupkgs)
62+
$DestinationNupkgPath = ".\build\bin\$OneBranchArch`_$OneBranchConfig\packages"
63+
64+
if (-not (Test-Path -Path $DestinationNupkgPath)) {
65+
New-Item -ItemType Directory -Path $DestinationNupkgPath
6866
}
69-
else {
70-
throw ("Configuration $OneBranchConfig|$OneBranchArch is not supported.")
71-
}
67+
68+
xcopy /y $SourceNupkgPath $DestinationNupkgPath
69+
Copy-BuildFolder -Configuration $OneBranchConfig -Arch $OneBranchArch

Diff for: tools/nuget/nuget.proj

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<Project Sdk="Microsoft.Build.NoTargets">
66
<PropertyGroup>
77
<OutputPath>$(MSBuildThisFileDirectory)..\..\$(Platform)\$(Configuration)</OutputPath>
8-
<PackageId>eBPF-for-Windows.Extensions</PackageId>
8+
<PackageId Condition="'$(Configuration)' == 'Release'">eBPF-for-Windows.Extensions</PackageId>
9+
<PackageId Condition="'$(Configuration)' == 'Debug'">eBPF-for-Windows.Extensions.Debug</PackageId>
910
<IsPackable>true</IsPackable>
1011
<TargetFramework>netstandard2.0</TargetFramework>
1112
<Authors>eBPF for Windows Contributors</Authors>

0 commit comments

Comments
 (0)