diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 7ede5a0af..e9f3969a1 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -124,17 +124,19 @@ runs: # Notes on the configuration apart from what's also for dotnet build: # * NoWarn on NU5104 to not have warnings for prerelease dependencies, see: # https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5104. - # * -p:WarnOnPackingNonPackableProject=True will cause a build warning (converted to error) if we try to pack - # a non-packagable project. + # * -p:WarnOnPackingNonPackableProject=True will cause a build warning (converted to error) if we try to pack a + # non-packagable project. # * -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg are needed to generate symbol packages: # https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg. + # * p:EnablePackageValidation=true is for package validation, see: + # https://docs.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview. run: | if ([string]::IsNullOrWhiteSpace($Env:API_KEY)) { Write-Output "::error::API_KEY is missing or empty." exit 1 } - $noWarn = @('NU5104') + @' + $noWarn = @('NU5104%3BCS1573%3BCS1591%3BVSTHRD002%3BVSTHRD200') + @' ${{ inputs.dotnet-pack-ignore-warning }} '@.Split() | ? { $_ } @@ -142,7 +144,6 @@ runs: "--configuration:Release", "--warnaserror", "--no-restore", - "--no-build", "--output:" + (Join-Path $PWD artifacts), "--verbosity:${{ inputs.verbosity }}", "-p:NuGetBuild=true", @@ -154,7 +155,8 @@ runs: "-p:WarnOnPackingNonPackableProject=True", "-p:IncludeSymbols=${{ inputs.dotnet-pack-include-symbols }}", "-p:SymbolPackageFormat=snupkg", - "-p:NoDefaultExcludes=true" + "-p:NoDefaultExcludes=true", + "-p:EnablePackageValidation=true" ) - name: Push with dotnet