Fail build when nugets aren't consolidated (#22233)

* fail build when nugets aren't consolidated

* consolidate nugets

* change tool install

* consolidate nugets

* fix message
This commit is contained in:
Davide Giacometti
2022-11-24 20:45:51 +01:00
committed by GitHub
parent f41fe145fc
commit b9367c0ca6
4 changed files with 38 additions and 1 deletions

View File

@@ -7,6 +7,13 @@ steps:
submodules: true
clean: true
- task: PowerShell@2
displayName: Verifying Nuget packages for PowerToys.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyNugetPackages.ps1'
arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for PowerToys.sln
inputs:

View File

@@ -0,0 +1,18 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$solution
)
Write-Host "Verifying Nuget packages for $solution"
dotnet tool restore
dotnet consolidate -s $solution
if (-not $?)
{
Write-Host -ForegroundColor Red "Nuget packages with the same name must all be the same version."
exit 1
}
exit 0