[CI] Condense NuGet Restore into MSBuild Tasks (#27028)

* Remove NuGet Restore tasks and incorporate msbuild restore target

* Add RestorePackagesConfig msbuild argument

* Add RestorePackagesConfig argument for installer

* Remove NuGet installer task

* Added Nuget Restore static graph

* Applied build and restore changes to release pipeline

* Removed NuGet Restore Static Graph

* Set NuGet Restore Graph only to main PowerToys solution

* Removed typo

* Fix path format issue

* Added release pattern

* Removed NuGet Restore Package Graph Options

* Updating NuGet authenticate task.

* Use restore switch in CI

* Use restore switch in Release

* Removed Packages Path
This commit is contained in:
Jeremy Sinclair 2023-08-16 12:31:10 -04:00 committed by GitHub
parent 7c5f2a5dc1
commit 3244ba9899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 87 deletions

View File

@ -115,6 +115,7 @@ TestCase\("[^"]+"
\\Registry
\\registry
\\reinstall
\\release
\\Resize
\\resource
\\Resources

View File

@ -1,7 +1,7 @@
parameters:
configuration: 'Release'
platform: ''
additionalBuildArguments: '-m'
additionalBuildArguments: '/p:RestorePackagesConfig=true -m'
jobs:
- job: Build${{ parameters.platform }}${{ parameters.configuration }}

View File

@ -1,7 +1,7 @@
parameters:
configuration: 'Release'
platform: ''
additionalBuildArguments: '-m'
additionalBuildArguments: '/p:RestorePackagesConfig=true -m'
jobs:
- job: Build${{ parameters.platform }}${{ parameters.configuration }}

View File

@ -55,21 +55,9 @@ steps:
packageType: sdk
version: '7.x'
- task: NuGetToolInstaller@1
displayName: Ensure NuGet Installer
- task: VisualStudioTestPlatformInstaller@1
displayName: Ensure VSTest Platform
- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToys.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: PowerToys.sln
restoreDirectory: '$(Build.SourcesDirectory)\packages'
- task: VSBuild@1
displayName: 'Build PowerToys.sln'
inputs:
@ -77,18 +65,9 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for BugReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\BugReportTool\BugReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\BugReportTool\packages'
- task: VSBuild@1
displayName: 'Build BugReportTool.sln'
inputs:
@ -96,18 +75,9 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for WebcamReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\WebcamReportTool\WebcamReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\WebcamReportTool\packages'
- task: VSBuild@1
displayName: 'Build WebcamReportTool.sln'
inputs:
@ -115,18 +85,9 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for StylesReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\StylesReportTool\StylesReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\StylesReportTool\packages'
- task: VSBuild@1
displayName: 'Build StylesReportTool.sln'
inputs:
@ -134,18 +95,9 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToysSetup.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: installer\PowerToysSetup.sln
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'
- task: PowerShell@2
displayName: Download and install WiX 3.14 development build
inputs:
@ -159,7 +111,7 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }}
msbuildArgs: /t:PowerToysInstaller -restore ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: VSBuild@1
@ -180,15 +132,6 @@ steps:
script: git clean -xfd -e *exe -- .\installer\
pwsh: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToysSetup.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: installer\PowerToysSetup.sln
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'
- task: VSBuild@1
displayName: 'Build PowerToys per-user MSI'
inputs:
@ -196,7 +139,7 @@ steps:
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }} /p:PerUser=true
msbuildArgs: /t:PowerToysInstaller -restore ${{ parameters.additionalBuildArguments }} /p:PerUser=true
maximumCpuCount: true
- task: VSBuild@1

View File

@ -18,7 +18,7 @@ steps:
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysSetupCustomActions /p:RunBuildEvents=true /p:PerUser=${{parameters.perUserArg}}
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysSetupCustomActions /p:RunBuildEvents=true /p:PerUser=${{parameters.perUserArg}}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true

View File

@ -71,7 +71,7 @@ jobs:
packageType: sdk
version: '7.x'
- task: NuGetAuthenticate@0
- task: NuGetAuthenticate@1
- task: NuGetToolInstaller@1
displayName: Use NuGet Installer latest
@ -82,14 +82,6 @@ jobs:
# - Webcam report tool
# - Installer
# - Bootstrapper Installer
- task: NuGetCommand@2
displayName: NuGet restore solutions dependencies
inputs:
command: restore
restoreSolution: '**/*.sln'
selectOrConfig: config
nugetConfigPath: .pipelines/release-nuget.config
- task: PowerShell@2
displayName: Download and install WiX 3.14 development build
inputs:
@ -136,7 +128,7 @@ jobs:
inputs:
solution: '**\PowerToys.sln'
vsVersion: 17.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
@ -147,7 +139,7 @@ jobs:
inputs:
solution: '**/tools/BugReportTool/BugReportTool.sln'
vsVersion: 17.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
@ -158,7 +150,7 @@ jobs:
inputs:
solution: '**/tools/WebcamReportTool/WebcamReportTool.sln'
vsVersion: 17.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
@ -169,7 +161,7 @@ jobs:
inputs:
solution: '**/tools/StylesReportTool/StylesReportTool.sln'
vsVersion: 17.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
@ -397,14 +389,6 @@ jobs:
script: git clean -xfd -e *exe -- .\installer\
pwsh: true
- task: NuGetCommand@2
displayName: NuGet restore solutions dependencies
inputs:
command: restore
restoreSolution: 'installer/*.sln'
selectOrConfig: config
nugetConfigPath: .pipelines/release-nuget.config
- template: installer-steps.yml
parameters:
versionNumber: ${{ parameters.versionNumber }}