diff options
author | Steve MacLean <Steve.MacLean@Microsoft.com> | 2019-02-11 16:39:44 -0500 |
---|---|---|
committer | Steve MacLean <stmaclea@microsoft.com> | 2019-02-15 16:28:03 -0500 |
commit | 51d033897eb5663ea8bab53704406d9fd82af98f (patch) | |
tree | 89b606d89a686f6787cc2bdf67b9190084547e25 /eng | |
parent | f97bd459f7ba5f76a799f41cac3e86b9b14899e3 (diff) | |
download | coreclr-51d033897eb5663ea8bab53704406d9fd82af98f.tar.gz coreclr-51d033897eb5663ea8bab53704406d9fd82af98f.tar.bz2 coreclr-51d033897eb5663ea8bab53704406d9fd82af98f.zip |
Publish version to dotnet/versions
Diffstat (limited to 'eng')
-rw-r--r-- | eng/build-job.yml | 6 | ||||
-rw-r--r-- | eng/finalize-publish.yml | 78 |
2 files changed, 84 insertions, 0 deletions
diff --git a/eng/build-job.yml b/eng/build-job.yml index f5d7b2293b..e2f24287c6 100644 --- a/eng/build-job.yml +++ b/eng/build-job.yml @@ -171,6 +171,12 @@ jobs: env: # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed NUGET_PACKAGES: $(Build.SourcesDirectory)\.packages + # Save nuget packages in pipeline for update dotnet/versions + - task: PublishPipelineArtifact@0 + displayName: Save packages as pipeline artifact + inputs: + artifactName: ${{ format('build_{0}_{1}_{2}_nuget', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} + targetPath: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper)/.nuget/pkg # Kill tasks that hold onto files on Windows. Otherwise git clean diff --git a/eng/finalize-publish.yml b/eng/finalize-publish.yml new file mode 100644 index 0000000000..b5fc307af2 --- /dev/null +++ b/eng/finalize-publish.yml @@ -0,0 +1,78 @@ +parameters: + # Optional: dependencies of the job + dependsOn: '' + + artifactsDir: $(Build.StagingDirectory)/artifacts + + gitHubUser: dotnet-build-bot + gitHubEmail: dotnet-build-bot@microsoft.com + gitHubAuthToken: $(AccessToken-dotnet-build-bot-public-repo) + + versionsRepoOwner: dotnet + versionsRepo: versions + +jobs: + - template: /eng/common/templates/job/publish-build-assets.yml + parameters: + configuration: Release + pool: + name: dotnet-internal-temp + dependsOn: ${{ parameters.dependsOn }} + # Update dotnet/versions + - job: Finalize_Publish_Versions + displayName: Finalize_Publish_Versions + dependsOn: + - Asset_Registry_Publish + pool: + name: Hosted VS2017 + variables: + - group: DotNet-Versions-Publish + steps: + # Download nuget packages + # Use parameters.dependsOn to determine the set of nuget packages we are publishing + - ${{ each build_id in parameters.dependsOn }}: + - task: DownloadPipelineArtifact@0 + displayName: Download ${{ build_id }} nuget packages + inputs: + artifactName: ${{ build_id }}_nuget + targetPath: ${{ parameters.artifactsDir }}/nuget + + - powershell: | + $prefix = "refs/heads/" + $branch = "$(Build.SourceBranch)" + $branchName = $branch + if ($branchName.StartsWith($prefix)) + { + $branchName = $branchName.Substring($prefix.Length) + } + 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 + + displayName: Run UpdatePublishedVersions.ps1 + + - task: CopyFiles@2 + displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + *.log + *.binlog + TargetFolder: '$(Build.StagingDirectory)\BuildLogs' + continueOnError: true + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact BuildLogs + inputs: + PathtoPublish: '$(Build.StagingDirectory)\BuildLogs' + ArtifactName: Finalize_Publish_Versions + condition: succeededOrFailed() |