File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,12 +88,14 @@ jobs:
8888
8989 echo "::group::C# (NuGet)"
9090 dotnet --list-sdks || true
91- # Disable analyzers / warnings-as-errors and treat this as a plain library pack.
92- # The client pulls Microsoft.CodeAnalysis + EnforceExtendedAnalyzerRules, whose RS-rule
93- # enforcement differs across SDKs and fails the runner build; none of it is needed to pack.
91+ CSPROJ="$C/Cyaim.WebSocketServer.Client/Cyaim.WebSocketServer.Client.csproj"
9492 CS_PROPS="-p:RunAnalyzers=false -p:EnforceExtendedAnalyzerRules=false -p:TreatWarningsAsErrors=false -p:EnableNETAnalyzers=false"
95- dotnet pack "$C/Cyaim.WebSocketServer.Client/Cyaim.WebSocketServer.Client.csproj" -c Release $CS_PROPS -o "$GITHUB_WORKSPACE/artifacts" \
96- || dotnet pack "$C/Cyaim.WebSocketServer.Client/Cyaim.WebSocketServer.Client.csproj" -c Release $CS_PROPS -p:TargetFrameworks=net8.0 -o "$GITHUB_WORKSPACE/artifacts" \
93+ # Build first (the project sets GeneratePackageOnBuild, so the build itself produces the
94+ # .nupkg), then pack --no-build. This avoids NU5026 ("dll to be packed was not found"),
95+ # which happens when pack -o runs before the per-TFM build output lands.
96+ dotnet build "$CSPROJ" -c Release $CS_PROPS
97+ dotnet pack "$CSPROJ" -c Release $CS_PROPS --no-build -o "$GITHUB_WORKSPACE/artifacts" \
98+ || find "$C/Cyaim.WebSocketServer.Client" -path "*/bin/Release/*" -name "*.nupkg" -exec cp {} "$GITHUB_WORKSPACE/artifacts/" \; \
9799 || echo "C# pack failed"
98100 echo "::endgroup::"
99101
You can’t perform that action at this time.
0 commit comments