Skip to content

Commit 3fa2265

Browse files
Fix release pipeline: nuspec path, snupkg, auto-pack noise, --no-build
The previous workflow run failed with NU5008 because /p:NuspecFile=..\..\GXOData.Client.nuspec on the command line did not resolve correctly relative to the GXOData.Client.All csproj during `dotnet pack`. - src/GXOdata.Client.All/GXOData.Client.All.csproj: * Move NuspecFile to the csproj using $(MSBuildThisFileDirectory) so the path is absolute and unambiguous. Also set NuspecBasePath so file entries in the nuspec resolve from the repo root. * Set IncludeSymbols=false. The nuspec doesn't enumerate source/symbol files, so pack was failing with NU5005 trying to build the snupkg. * Set GeneratePackageOnBuild=false (overrides upstream Directory.Build.props), otherwise build would ship an extra default-versioned GXOData.Client.All.1.0.0.nupkg alongside the proper GeneXus.Odata.Client.*.nupkg. - .github/workflows/build.yml: * Drop /p:NuspecFile=..\..\:NuspecFile from the Package step (now in csproj). * Add --no-build to the Package step so pack reuses the msbuild artifacts instead of doing its own incremental build, which was hitting transient CS0518 on netstandard2.0. * Filter Sign and Publish to GeneXus.Odata.Client.*.nupkg only. Upstream csprojs (Simple.OData.Client.Core, V3.Adapter, V4.Adapter) auto-pack with their original IDs and default 1.0.0 version — we don't want to sign or publish those. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 18875cc commit 3fa2265

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: dotnet msbuild $Env:SolutionFile -p:Configuration=$Env:Configuration /t:Clean,Build
7373

7474
- name: Package
75-
run: dotnet pack $Env:SolutionFile --output $Env:PackageFolder /p:NuspecFile=..\..\$Env:NuspecFile
75+
run: dotnet pack $Env:SolutionFile --no-build --output $Env:PackageFolder
7676

7777
- name: Sign
7878
if: github.base_ref == ''
@@ -97,7 +97,11 @@ jobs:
9797
-Body $body).access_token
9898
Write-Host "::add-mask::$token"
9999
100-
Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object {
100+
# Only operate on the GeneXus meta-package. Upstream csprojs auto-pack with
101+
# their own IDs (Simple.OData.Client.*) which we don't want to sign or publish.
102+
Get-ChildItem ".\*.nupkg" -Recurse |
103+
Where-Object { $_.Name -like "GeneXus.Odata.Client.*.nupkg" } |
104+
ForEach-Object {
101105
dotnet tool run NuGetKeyVaultSignTool sign $_.FullName `
102106
-kvu $Env:VAULT_URL `
103107
-kvc $Env:CERT_NAME `
@@ -129,7 +133,11 @@ jobs:
129133
run: |
130134
$IsPrerelease = "${{ github.ref }}".StartsWith("refs/heads/")
131135
132-
Get-ChildItem ".\*.nupkg" -Recurse | ForEach-Object {
136+
# Only operate on the GeneXus meta-package. Upstream csprojs auto-pack with
137+
# their own IDs (Simple.OData.Client.*) which we don't want to sign or publish.
138+
Get-ChildItem ".\*.nupkg" -Recurse |
139+
Where-Object { $_.Name -like "GeneXus.Odata.Client.*.nupkg" } |
140+
ForEach-Object {
133141
$PushToGitHubArgs = @("nuget", "push", $_.FullName, "--source", $Env:GPRFeedURL, "--api-key", "${{ secrets.SECURE_TOKEN }}")
134142
$PushToNugetArgs = @("nuget", "push", $_.FullName, "--source", $Env:NuGetFeedURL, "--api-key", "${{ secrets.NUGET_ORG_TOKEN }}")
135143
$PushToAzureArgs = @("nuget", "push", $_.FullName, "--source", $Env:AZURE_ARTIFACTS_URL, "--api-key", "DUMMY-KEY")

src/GXOdata.Client.All/GXOData.Client.All.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
<DocumentationFile>..\GXOData.Client.All\GXOData.Client.All.xml</DocumentationFile>
1010
<DefineConstants>TRACE</DefineConstants>
1111
<NoWarn>1701;1702;1705;1591;1712;1573</NoWarn>
12+
<!-- Absolute path to the nuspec living at the repo root. Passing this relative
13+
via -p:NuspecFile=..\..\GXOData.Client.nuspec on the command line did not
14+
resolve correctly inside `dotnet pack`. -->
15+
<NuspecFile>$(MSBuildThisFileDirectory)..\..\GXOData.Client.nuspec</NuspecFile>
16+
<NuspecBasePath>$(MSBuildThisFileDirectory)..\..\</NuspecBasePath>
17+
<!-- The nuspec doesn't enumerate source/symbol files, so let pack skip the snupkg. -->
18+
<IncludeSymbols>false</IncludeSymbols>
19+
<!-- The release nupkg is produced by the explicit `dotnet pack` step in the workflow.
20+
Suppress the auto-pack on build that upstream's Directory.Build.props turns on,
21+
otherwise we ship an extra (default-versioned) GXOData.Client.All.1.0.0.nupkg. -->
22+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1223
</PropertyGroup>
1324

1425
<PropertyGroup Condition="'$(Configuration)'=='Debug'">

0 commit comments

Comments
 (0)