From d82205ef52c29b3c7aa8d2a9e8bfbf44f6f4959d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 18 Sep 2019 15:25:05 -0700 Subject: [PATCH] Fix update versions logic (dotnet/coreclr#26768) * 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 --- eng/finalize-publish.yml | 19 ++++++++------- eng/updateversions.proj | 6 ++++- src/coreclr/UpdatePublishedVersions.ps1 | 31 ------------------------- 3 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 src/coreclr/UpdatePublishedVersions.ps1 diff --git a/eng/finalize-publish.yml b/eng/finalize-publish.yml index 25900528c6709..1afd8bdd7f938 100644 --- a/eng/finalize-publish.yml +++ b/eng/finalize-publish.yml @@ -49,16 +49,17 @@ jobs: 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 diff --git a/eng/updateversions.proj b/eng/updateversions.proj index 891425227d0f3..cae08126bfd57 100644 --- a/eng/updateversions.proj +++ b/eng/updateversions.proj @@ -6,6 +6,10 @@ - + + + + + diff --git a/src/coreclr/UpdatePublishedVersions.ps1 b/src/coreclr/UpdatePublishedVersions.ps1 deleted file mode 100644 index a69ebdc6c977d..0000000000000 --- a/src/coreclr/UpdatePublishedVersions.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -# -# 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"