@@ -31,12 +31,47 @@ stages:
31
31
pool :
32
32
vmImage : ubuntu-latest
33
33
steps :
34
- - task : UseDotNet@2
35
- displayName : Use .NET Core 5.0.x SDK
36
- inputs :
37
- version : 5.0.x
38
- includePreviewVersions : true
34
+ # - task: UseDotNet@2
35
+ # displayName: Use .NET Core 5.0.x SDK
36
+ # inputs:
37
+ # version: 5.0.x
38
+ # includePreviewVersions: true
39
+ - pwsh : |
40
+ $branch = "release/5.0.1xx"
41
+ $scriptPath = Join-Path $env:AGENT_TOOLSDIRECTORY dotnet-install.ps1
42
+ Invoke-WebRequest -OutFile $scriptPath https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1
43
+ &"$scriptPath" -Channel $branch
44
+
45
+ $configFile = Join-Path $env:AGENT_TOOLSDIRECTORY NuGet-darc.config
46
+ # Get the darc feeds needed
47
+ Invoke-WebRequest -OutFile $configFile "https://raw.githubusercontent.com/dotnet/installer/$branch/NuGet.config"
48
+
49
+ [xml]$nugetConfig = Get-Content $configFile
50
+ $darcNodes = $nugetConfig.SelectNodes("/configuration/packageSources/add[starts-with(@key, 'darc-')]")
51
+
52
+ $installationPath = Join-Path $env:AGENT_TOOLSDIRECTORY dotnet
53
+
54
+ Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]$installationPath"
55
+
56
+ # Enable multi-level lookup to fall back to the built-in SDK's for older versions. Set to 0 to disable
57
+ Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]1"
58
+
59
+ # Make sure the new path is propagated back to the main host process
60
+ Write-Host "##vso[task.setvariable variable=PATH]$env:PATH"
61
+
62
+ # Add the nightly NuGet feeds to the nuget config starting with the darc nodes
63
+ foreach ($feed in $darcNodes) {
64
+ $key = $feed.attributes['key'].value
65
+ $value = $feed.attributes['value'].value
66
+
67
+ Write-Host "Adding DARC feed '$key': $value"
68
+ dotnet nuget add source $value -n $key
69
+ }
70
+
71
+ dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json -n dotnet5
39
72
73
+ displayName: Intall .NET 5.0 SDK
74
+
40
75
- task : UseDotNet@2
41
76
displayName : .NET Core 3.1 runtime
42
77
inputs :
0 commit comments