Skip to content

Commit ea422f9

Browse files
use task
1 parent e8e4534 commit ea422f9

File tree

1 file changed

+5
-40
lines changed

1 file changed

+5
-40
lines changed

azure-pipelines.ix.yml

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,11 @@ stages:
3131
pool:
3232
vmImage: ubuntu-latest
3333
steps:
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.sh
42-
Invoke-WebRequest -OutFile $scriptPath https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.sh
43-
bash "$scriptPath" /channel $branch /architecture x64
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
72-
73-
displayName: Intall .NET 5.0 SDK
34+
- task: UseDotNet@2
35+
displayName: Use .NET Core 5.0.x SDK
36+
inputs:
37+
version: 5.0.x
38+
includePreviewVersions: true
7439

7540
- task: UseDotNet@2
7641
displayName: .NET Core 3.1 runtime

0 commit comments

Comments
 (0)