Browse Source

Enable packages validation

pull/1784/head
Kévin Chalet 3 years ago
parent
commit
77d8d7492c
  1. 34
      .github/workflows/build.yml
  2. 5
      Directory.Build.props
  3. 1
      OpenIddict.sln
  4. 75
      eng/CompatibilitySuppressions.xml
  5. 1
      eng/Versions.props

34
.github/workflows/build.yml

@ -98,9 +98,37 @@ jobs:
name: testresults-${{ matrix.os_name }} name: testresults-${{ matrix.os_name }}
path: ./artifacts/TestResults/Release path: ./artifacts/TestResults/Release
push-myget: validate-packages:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages-windows
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Validate NuGet packages
shell: pwsh
run: |
dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
$packages = Get-ChildItem -Filter "*.nupkg" | ForEach-Object { $_.FullName }
$invalidPackages = 0
foreach ($package in $packages) {
dotnet validate package local $package
if ($LASTEXITCODE -ne 0) {
$invalidPackages++
}
}
if ($invalidPackages -gt 0) {
Write-Output "::error::$invalidPackages NuGet package(s) failed validation."
}
push-packages-myget:
needs: validate-packages
runs-on: ubuntu-latest
if: | if: |
github.event.repository.fork == false && github.event.repository.fork == false &&
(github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/')) (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/'))
@ -116,8 +144,8 @@ jobs:
- name: Push packages to MyGet.org - name: Push packages to MyGet.org
run: nuget push "*.nupkg" -ApiKey ${{ secrets.MYGET_API_KEY }} -SkipDuplicate -Source https://www.myget.org/F/openiddict/api/v3/index.json run: nuget push "*.nupkg" -ApiKey ${{ secrets.MYGET_API_KEY }} -SkipDuplicate -Source https://www.myget.org/F/openiddict/api/v3/index.json
push-nuget: push-packages-nuget:
needs: build needs: validate-packages
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/') if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/')
steps: steps:

5
Directory.Build.props

@ -60,12 +60,17 @@
<PropertyGroup Condition=" $(RepoRelativeProjectDir.Contains('src')) "> <PropertyGroup Condition=" $(RepoRelativeProjectDir.Contains('src')) ">
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnablePackageValidation>true</EnablePackageValidation>
<IncludeSymbols>true</IncludeSymbols> <IncludeSymbols>true</IncludeSymbols>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<IsShipping>true</IsShipping> <IsShipping>true</IsShipping>
<Serviceable>false</Serviceable> <Serviceable>false</Serviceable>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" $(RepoRelativeProjectDir.Contains('src')) ">
<ApiCompatSuppressionFile Include="$(MSBuildThisFileDirectory)eng\CompatibilitySuppressions.xml" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes> <PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
</PropertyGroup> </PropertyGroup>

1
OpenIddict.sln

@ -60,6 +60,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{6E8E862C-3F26-47D9-9C20-E3E87FD7CDFC}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{6E8E862C-3F26-47D9-9C20-E3E87FD7CDFC}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
eng\CodeAnalysis.ruleset = eng\CodeAnalysis.ruleset eng\CodeAnalysis.ruleset = eng\CodeAnalysis.ruleset
eng\CompatibilitySuppressions.xml = eng\CompatibilitySuppressions.xml
eng\key.snk = eng\key.snk eng\key.snk = eng\key.snk
eng\Signing.props = eng\Signing.props eng\Signing.props = eng\Signing.props
eng\Tools.props = eng\Tools.props eng\Tools.props = eng\Tools.props

75
eng/CompatibilitySuppressions.xml

@ -0,0 +1,75 @@
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConfiguration.#ctor</Target>
<Left>lib/net6.0/OpenIddict.Client.WebIntegration.dll</Left>
<Right>lib/net6.0/OpenIddict.Client.WebIntegration.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConfiguration.#ctor</Target>
<Left>lib/net7.0/OpenIddict.Client.WebIntegration.dll</Left>
<Right>lib/net7.0/OpenIddict.Client.WebIntegration.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationHelpers.GetWebAuthenticationResult(OpenIddict.Client.OpenIddictClientTransaction)</Target>
<Left>lib/netcoreapp3.1/OpenIddict.Client.SystemIntegration.dll</Left>
<Right>lib/net6.0-windows7.0/OpenIddict.Client.SystemIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationHelpers.GetWebAuthenticationResult(OpenIddict.Client.OpenIddictClientTransaction)</Target>
<Left>lib/netcoreapp3.1/OpenIddict.Client.SystemIntegration.dll</Left>
<Right>lib/net6.0/OpenIddict.Client.SystemIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConfiguration.#ctor</Target>
<Left>lib/netcoreapp3.1/OpenIddict.Client.WebIntegration.dll</Left>
<Right>lib/netcoreapp3.1/OpenIddict.Client.WebIntegration.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationConfiguration.#ctor(Microsoft.Extensions.Hosting.IHostingEnvironment)</Target>
<Left>lib/netstandard2.0/OpenIddict.Client.SystemIntegration.dll</Left>
<Right>lib/netcoreapp3.1/OpenIddict.Client.SystemIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationHandlers.AbortAuthenticationDemand.#ctor(OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationMarshal,Microsoft.Extensions.Hosting.IApplicationLifetime)</Target>
<Left>lib/netstandard2.0/OpenIddict.Client.SystemIntegration.dll</Left>
<Right>lib/netcoreapp3.1/OpenIddict.Client.SystemIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationHandlers.RedirectProtocolActivation.#ctor(Microsoft.Extensions.Hosting.IApplicationLifetime,Microsoft.Extensions.Options.IOptionsMonitor{OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationOptions},OpenIddict.Client.SystemIntegration.OpenIddictClientSystemIntegrationService)</Target>
<Left>lib/netstandard2.0/OpenIddict.Client.SystemIntegration.dll</Left>
<Right>lib/netcoreapp3.1/OpenIddict.Client.SystemIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConfiguration.#ctor(System.IServiceProvider)</Target>
<Left>lib/netstandard2.0/OpenIddict.Client.WebIntegration.dll</Left>
<Right>lib/netstandard2.1/OpenIddict.Client.WebIntegration.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConfiguration.#ctor</Target>
<Left>lib/netstandard2.1/OpenIddict.Client.WebIntegration.dll</Left>
<Right>lib/netstandard2.1/OpenIddict.Client.WebIntegration.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>

1
eng/Versions.props

@ -5,6 +5,7 @@
<MinorVersion>5</MinorVersion> <MinorVersion>5</MinorVersion>
<PatchVersion>0</PatchVersion> <PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix> <VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<PackageValidationBaselineVersion Condition=" '$(PackageValidationBaselineVersion)' == '' ">4.4.0</PackageValidationBaselineVersion>
<PreReleaseVersionLabel>preview1</PreReleaseVersionLabel> <PreReleaseVersionLabel>preview1</PreReleaseVersionLabel>
<PreReleaseVersionIteration></PreReleaseVersionIteration> <PreReleaseVersionIteration></PreReleaseVersionIteration>
<PreReleaseBrandingLabel>Preview 1</PreReleaseBrandingLabel> <PreReleaseBrandingLabel>Preview 1</PreReleaseBrandingLabel>

Loading…
Cancel
Save