summaryrefslogtreecommitdiff
path: root/eng/finalize-publish.yml
blob: 25900528c67096adaec3d35f88df426c204dd354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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: NetCoreInternal-Pool
        queue: BuildPool.Windows.10.Amd64.VS2017
      dependsOn: ${{ parameters.dependsOn }}
      publishUsingPipelines: true
  # 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
    - task: DownloadBuildArtifacts@0
      displayName: Download nuget package artifacts
      inputs:
        buildType: current
        artifactName: PackageArtifacts
        downloadPath: ${{ 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()