-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
install-dotnet.yml
35 lines (34 loc) · 1.43 KB
/
install-dotnet.yml
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
parameters:
EnableNuGetCache: true
NuGetCacheKey: 'Build'
Container: false
steps:
- task: MSBuild@1
displayName: Install DevOps Logger
condition: and(succeeded(), eq(${{ parameters.Container }}, false))
inputs:
solution: eng/InstallDevopsLogger.proj
msbuildArguments: /p:WorkFolder="$(Agent.WorkFolder)" /p:BuildDirectory="$(Agent.BuildDirectory)"
# Installation steps need to be uncommented when switching to a newer SDK that's not available on DevOps agents
- task: UseDotNet@2
displayName: 'Use .NET SDK'
retryCountOnTaskFailure: 3
inputs:
useGlobalJson: true
performMultiLevelLookup: true
- task: UseDotNet@2 # We need .NET 6 for azure-sdk-tools and the .NET 6 tests
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT')) # Windows supports MultiLevelLookup and doesn't need explicit framework installation
displayName: 'Use .NET 6.0 SDK'
retryCountOnTaskFailure: 3
inputs:
# AspNetCore runtime pack can't be installed outside of SDK and we need it for integration tests
packageType: sdk
performMultiLevelLookup: true
version: "6.0.x"
- task: Cache@2
inputs:
key: 'nuget | "$(Agent.OS)" | $(Build.SourcesDirectory)/eng/Packages.Data.props | ${{parameters.NuGetCacheKey}}'
path: $(NUGET_PACKAGES)
condition: and(succeeded(), ${{parameters.EnableNuGetCache}})
continueOnError: true
displayName: Cache NuGet packages