|
| 1 | +# Pipeline creates a dotnet with experimental msbuild dlls. |
| 2 | + |
| 3 | +trigger: none # Prevents this pipeline from triggering on check-ins |
| 4 | +pr: none # don't run this on PR as well |
| 5 | + |
| 6 | +parameters: |
| 7 | + # Dotnet installer channel from where to take the latest dotnet bits. |
| 8 | + - name: DotnetInstallerChannel |
| 9 | + displayName: Dotnet installer channel |
| 10 | + type: string |
| 11 | + # Branch from the MSBuild Build CI pipeline. Default: main |
| 12 | + # Top run for the branch would be used to create an experimental insertion. |
| 13 | + - name: MSBuildBranch |
| 14 | + displayName: MSBuild Branch |
| 15 | + type: string |
| 16 | + default: 'refs/heads/main' |
| 17 | + # BuildID from the MSBuild Build CI pipeline. Overrides the choice of MSBuildBranch parameter |
| 18 | + - name: MSBuildBuildID |
| 19 | + displayName: MSBuild CI Run Override |
| 20 | + type: string |
| 21 | + default: 'default' |
| 22 | + |
| 23 | +variables: |
| 24 | + - name: _MsBuildCiPipelineId |
| 25 | + value: 9434 |
| 26 | + |
| 27 | +pool: |
| 28 | + vmImage: windows-latest |
| 29 | + |
| 30 | +steps: |
| 31 | +- powershell: | |
| 32 | + mkdir '$(System.ArtifactsDirectory)/installer' |
| 33 | +
|
| 34 | + $dotnetChannel = '${{parameters.DotnetInstallerChannel}}' |
| 35 | + $sdks = "dotnet-sdk-win-x64.zip", "dotnet-sdk-linux-x64.tar.gz" |
| 36 | +
|
| 37 | + foreach ($sdk in $sdks) |
| 38 | + { |
| 39 | + Write-Host "Downloading dotnet $sdk from channel $dotnetChannel" |
| 40 | + Invoke-WebRequest ` |
| 41 | + -Uri "https://aka.ms/dotnet/$dotnetChannel/daily/$sdk" ` |
| 42 | + -OutFile "$(System.ArtifactsDirectory)/installer/$sdk" |
| 43 | + } |
| 44 | + mkdir '$(Pipeline.Workspace)/artifacts' |
| 45 | + |
| 46 | + displayName: Download latest dotnet sdks |
| 47 | + |
| 48 | +# Download latest build artifacts for a branch from MSBuild Build CI |
| 49 | +- ${{ if eq(parameters.MSBuildBuildID, 'default') }}: |
| 50 | + - task: DownloadBuildArtifacts@1 |
| 51 | + inputs: |
| 52 | + buildType: specific |
| 53 | + project: DevDiv |
| 54 | + pipeline: $(_MsBuildCiPipelineId) |
| 55 | + buildVersionToDownload: latestFromBranch |
| 56 | + branchName: '${{parameters.MSBuildBranch}}' |
| 57 | + artifactName: bin |
| 58 | + downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin' |
| 59 | + itemPattern: "MSBuild.Bootstrap/**" |
| 60 | + displayName: Download latest msbuild from branch |
| 61 | + |
| 62 | +# Download build artifacts for MSBuild Build CI specific build |
| 63 | +- ${{ if ne(parameters.MSBuildBuildID, 'default') }}: |
| 64 | + - task: DownloadBuildArtifacts@1 |
| 65 | + inputs: |
| 66 | + buildType: specific |
| 67 | + project: DevDiv |
| 68 | + pipeline: $(_MsBuildCiPipelineId) |
| 69 | + buildVersionToDownload: specific |
| 70 | + buildId: ${{parameters.MSBuildBuildID}} |
| 71 | + artifactName: bin |
| 72 | + downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin' |
| 73 | + itemPattern: "MSBuild.Bootstrap/**" |
| 74 | + displayName: Download specified msbuild build |
| 75 | + |
| 76 | +- powershell: | |
| 77 | + $sdk = "dotnet-sdk-win-x64" |
| 78 | +
|
| 79 | + Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.zip" |
| 80 | + Expand-Archive "$(System.ArtifactsDirectory)/installer/$sdk.zip" -DestinationPath "$(Pipeline.Workspace)/exp-dotnet/$sdk" |
| 81 | + |
| 82 | + $dotnetDirectory = Get-ChildItem -Directory -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk" |
| 83 | + $dotnetVersion = $dotnetDirectory.Name |
| 84 | + Write-Host "Detected dotnet version: $dotnetVersion" |
| 85 | + |
| 86 | + Write-Host "Updating MSBuild dlls." |
| 87 | + $(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 ` |
| 88 | + -destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" ` |
| 89 | + -bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" ` |
| 90 | + -configuration Release ` |
| 91 | + -makeBackup $false |
| 92 | + |
| 93 | + Write-Host "Compressing dotnet sdk files" |
| 94 | + Get-ChildItem -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk" | Compress-Archive -DestinationPath "$(Pipeline.Workspace)/artifacts/$sdk.zip" |
| 95 | +
|
| 96 | + displayName: Dogfood msbuild dlls to dotnet sdk win-x64 |
| 97 | + |
| 98 | +- powershell: | |
| 99 | + $sdk = "dotnet-sdk-linux-x64" |
| 100 | + |
| 101 | + mkdir "$(Pipeline.Workspace)/exp-dotnet/$sdk" |
| 102 | +
|
| 103 | + Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.tar.gz" |
| 104 | + tar -xzvf "$(System.ArtifactsDirectory)/installer/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" |
| 105 | +
|
| 106 | + $dotnetDirectory = Get-ChildItem -Directory -Path $(Pipeline.Workspace)/exp-dotnet/$sdk/sdk |
| 107 | + $dotnetVersion = $dotnetDirectory.Name |
| 108 | + Write-Host "Detected dotnet version: $dotnetVersion" |
| 109 | + |
| 110 | + Write-Host "Updating MSBuild dlls." |
| 111 | + $(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 ` |
| 112 | + -destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" ` |
| 113 | + -bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" ` |
| 114 | + -configuration Release ` |
| 115 | + -makeBackup $false |
| 116 | + |
| 117 | + Write-Host "Compressing dotnet sdk files" |
| 118 | + tar -czvf "$(Pipeline.Workspace)/artifacts/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" . |
| 119 | + displayName: Dogfood msbuild dlls to dotnet sdk linux-x64 |
| 120 | + |
| 121 | +- task: PublishPipelineArtifact@1 |
| 122 | + inputs: |
| 123 | + targetPath: '$(Pipeline.Workspace)/artifacts' |
| 124 | + artifactName: ExperimentalDotnet |
| 125 | + parallel: true |
| 126 | + condition: always() |
| 127 | + displayName: Publish crank assests artifacts |
0 commit comments