2020variables :
2121 solution : ' src\AppInstallerCLI.sln'
2222 EnableDetectorVcpkg : true
23+ EnablePipelineCache : true
24+ VCPKG_BINARY_SOURCES : " clear;nuget,https://pkgs.dev.azure.com/shine-oss/winget-cli/_packaging/WinGetDependencies/nuget/v3/index.json,readwrite"
2325
2426# Do not set the build version for a PR build.
2527
5759 artifactIdentifier : ' x64release'
5860
5961 variables :
60- BuildVer : $[counter(dependencies.GetReleaseTag.outputs['GetTag.tag'], 1)]
6162 buildOutDir : $(Build.SourcesDirectory)\src\$(buildPlatform)\$(buildConfiguration)
6263 buildOutDirAnyCpu : $(Build.SourcesDirectory)\src\AnyCPU\$(buildConfiguration)
6364 artifactsDir : $(Build.ArtifactStagingDirectory)\$(buildPlatform)
6768 - task : NuGetToolInstaller@1
6869 displayName : Install Nuget
6970
71+ - task : NuGetAuthenticate@1
72+ displayName : Authenticate to NuGet Feed
73+
74+ - task : PowerShell@2
75+ displayName : Configure vcpkg NuGet binary cache credentials
76+ inputs :
77+ targetType : inline
78+ script : |
79+ $nugetExe = (& "$(VCPKG_INSTALLATION_ROOT)\vcpkg.exe" fetch nuget) | Select-Object -Last 1
80+ $feedUrl = "https://pkgs.dev.azure.com/shine-oss/winget-cli/_packaging/WinGetDependencies/nuget/v3/index.json"
81+ & $nugetExe sources add -Name "WinGetDependencies" -Source $feedUrl -Username "AzureDevOps" -Password "$env:SYSTEM_ACCESSTOKEN" -StorePasswordInClearText
82+ & $nugetExe setapikey "AzureDevOps" -Source $feedUrl
83+ env :
84+ SYSTEM_ACCESSTOKEN : $(System.AccessToken)
85+
7086 # Restores all projects, including native (vcxproj) projects
7187 - task : NuGetCommand@2
7288 displayName : Restore Solution
@@ -104,7 +120,7 @@ jobs:
104120 condition : not(eq(variables['Build.Reason'], 'PullRequest'))
105121 inputs :
106122 filePath : ' src\binver\Update-BinVer.ps1'
107- arguments : ' -TargetFile binver\binver\version.h -BuildVersion $(BuildVer) '
123+ arguments : ' -TargetFile binver\binver\version.h'
108124 workingDirectory : ' src'
109125
110126 # Build all solutions in the root directory.
@@ -114,13 +130,17 @@ jobs:
114130 platform : ' $(buildPlatform)'
115131 solution : ' $(solution)'
116132 configuration : ' $(buildConfiguration)'
117- msbuildArgs : ' /bl:$(artifactsDir)\msbuild.binlog
133+ msbuildArgs : ' /graph /reportfileaccesses
134+ /bl:$(artifactsDir)\msbuild.binlog
118135 /p:AppxBundlePlatforms="$(buildPlatform)"
119136 /p:AppxPackageDir="$(appxPackageDir)"
120137 /p:AppxBundle=Always
121138 /p:UapAppxPackageBuildMode=SideloadOnly
122- /p:WingetCleanIntermediateFiles=true '
139+ /p:WingetCleanIntermediateFiles=false '
123140 maximumCpuCount : true
141+ msbuildArchitecture : x64
142+ env :
143+ SYSTEM_ACCESSTOKEN : $(System.AccessToken)
124144
125145 - task : MSBuild@1
126146 displayName : Build MSIX Test Installer File
@@ -672,6 +692,21 @@ jobs:
672692 - task : NuGetToolInstaller@1
673693 displayName : Install Nuget
674694
695+ - task : NuGetAuthenticate@1
696+ displayName : Authenticate to NuGet Feed
697+
698+ - task : PowerShell@2
699+ displayName : Configure vcpkg NuGet binary cache credentials
700+ inputs :
701+ targetType : inline
702+ script : |
703+ $nugetExe = (& "$(VCPKG_INSTALLATION_ROOT)\vcpkg.exe" fetch nuget) | Select-Object -Last 1
704+ $feedUrl = "https://pkgs.dev.azure.com/shine-oss/winget-cli/_packaging/WinGetDependencies/nuget/v3/index.json"
705+ & $nugetExe sources add -Name "WinGetDependencies" -Source $feedUrl -Username "AzureDevOps" -Password "$env:SYSTEM_ACCESSTOKEN" -StorePasswordInClearText
706+ & $nugetExe setapikey "AzureDevOps" -Source $feedUrl
707+ env :
708+ SYSTEM_ACCESSTOKEN : $(System.AccessToken)
709+
675710 - task : NuGetCommand@2
676711 displayName : Restore Solution
677712 inputs :
@@ -690,7 +725,7 @@ jobs:
690725 platform : ' $(buildPlatform)'
691726 solution : ' $(solution)'
692727 configuration : ' $(buildConfiguration)'
693- msbuildArgs : ' /bl:$(artifactsDir)\msbuild.binlog'
728+ msbuildArgs : ' /bl:$(artifactsDir)\msbuild.binlog /p:MSBuildCacheEnabled=false '
694729 maximumCpuCount : true
695730
696731 - task : CopyFiles@2
0 commit comments