* Fix update versions logic
After https://github.com/dotnet/coreclr/pull/26108, this was broken
because the Tools.proj was never restored on the agent running the
finalize-publish job. This fixes the script to do a restore, and adds
a missing import.
* Remove UpdatePublishedVersions.ps1 and add darc dependency
Commit migrated from https://github.com/dotnet/coreclr/commit/
9be00be2ad5586d93864a77ef4c706fc9be89467
Write-Host "For Build.SourceBranch $branch, FullBranchName is $branchName"
Write-Host "##vso[task.setvariable variable=FullBranchName;]$branchName"
ls -R ${{ parameters.artifactsDir }}/nuget/*.nupkg
- $(Build.SourcesDirectory)/UpdatePublishedVersions.ps1 `
- -gitHubUser ${{ parameters.gitHubUser }} `
- -gitHubEmail ${{ parameters.gitHubEmail }} `
- -gitHubAuthToken ${{ parameters.gitHubAuthToken }} `
- -versionsRepoOwner ${{ parameters.versionsRepoOwner }} `
- -versionsRepo ${{ parameters.versionsRepo }} `
- -versionsRepoPath build-info/dotnet/coreclr/$branchName `
- -nupkgPath ${{ parameters.artifactsDir }}/nuget/*.nupkg
+ & $(Build.SourcesDirectory)/eng/common/build.ps1 -restore -build -ci `
+ -projects "$(Build.SourcesDirectory)/eng/updateversions.proj" `
+ /p:GitHubUser="${{ parameters.gitHubUser }}" `
+ /p:GitHubEmail="${{ parameters.gitHubEmail }}" `
+ /p:GitHubAuthToken="${{ parameters.gitHubAuthToken }}" `
+ /p:VersionsRepoOwner="${{ parameters.versionsRepoOwner }}" `
+ /p:VersionsRepo="${{ parameters.versionsRepo }}" `
+ /p:VersionsRepoPath="build-info/dotnet/coreclr/$branchName" `
+ /p:ShippedNuGetPackageGlobPath="${{ parameters.artifactsDir }}/nuget/*.nupkg"
- displayName: Run UpdatePublishedVersions.ps1
+ displayName: Update dotnet/versions
- task: CopyFiles@2
displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
- <Import Project="$(NuGetPackageRoot)\microsoft.dotnet.versiontools.tasks\$(MicrosoftDotNetVersionToolsTasksPackageVersion)\build\Microsoft.DotNet.VersionTools.Tasks.targets" />
+ <Import Project="$(NuGetPackageRoot)\microsoft.dotnet.versiontools.tasks\$(MicrosoftDotNetVersionToolsTasksVersion)\build\Microsoft.DotNet.VersionTools.Tasks.props" />
+
+ <Import Project="$(NuGetPackageRoot)\microsoft.dotnet.versiontools.tasks\$(MicrosoftDotNetVersionToolsTasksVersion)\build\Microsoft.DotNet.VersionTools.Tasks.targets" />
+
+ <Target Name="Build" DependsOnTargets="UpdatePublishedVersions" />
</Project>
+++ /dev/null
-#
-# Copyright (c) .NET Foundation and contributors. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-# This script updates the dotnet/versions repository based on a set of packages. It directly
-# commits the changes using GitHub APIs.
-
-param(
- [Parameter(Mandatory=$true)][string]$gitHubUser,
- [Parameter(Mandatory=$true)][string]$gitHubEmail,
- [Parameter(Mandatory=$true)][string]$gitHubAuthToken,
- [Parameter(Mandatory=$true)][string]$versionsRepoOwner,
- [Parameter(Mandatory=$true)][string]$versionsRepo,
- [Parameter(Mandatory=$true)][string]$versionsRepoPath,
- # A pattern matching all packages in the set that the versions repository should be set to.
- [Parameter(Mandatory=$true)][string]$nupkgPath)
-
-& "$PSScriptRoot\dotnet.cmd" msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false `
- /p:RestoreDefaultOptimizationDataPackage=false `
- /p:PortableBuild=true `
- /p:UsePartialNGENOptimization=false `
- /maxcpucount `
- "$PSScriptRoot\eng\updateversions.proj" /t:UpdatePublishedVersions `
- /p:GitHubUser="$gitHubUser" `
- /p:GitHubEmail="$gitHubEmail" `
- /p:GitHubAuthToken="$gitHubAuthToken" `
- /p:VersionsRepoOwner="$versionsRepoOwner" `
- /p:VersionsRepo="$versionsRepo" `
- /p:VersionsRepoPath="$versionsRepoPath" `
- /p:ShippedNuGetPackageGlobPath="$nupkgPath"