Skip to content

Commit

Permalink
Allow using specific NuGet tool version. (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Wim Vergouwe <[email protected]>
  • Loading branch information
WimVergouwe and Wim Vergouwe authored Jan 12, 2022
1 parent 3781b17 commit 5ebb3e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions azure/pipelines/dotnet/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ parameters:
default: false
displayName: 'Whether to push created NuGets to external feed and/or add publish output to pipeline artifacts.'

- name: NuGetToolVersion
type: string
default: ''
displayName: 'Specifc NuGet tool version to use.'
- name: NuGetConfigPath
type: string
default: '.nuget/NuGet.Config'
Expand All @@ -60,6 +64,14 @@ parameters:
displayName: 'Whether to cache NuGet packages. NUGET_PACKAGES environment variable still needs to be set though.'

steps:
- ${{ if ne(parameters.NuGetToolVersion, '') }}:
# Hosted build agent windows-2022 doesn't seem to auto select right nuget version, so we allow to set it explicitly.
# See https://github.com/actions/virtual-environments/issues/4754
- task: NuGetToolInstaller@1
displayName: 'Use specific NuGet tool version ${{ parameters.NuGetToolVersion }}'
inputs:
versionSpec: ${{ parameters.NuGetToolVersion }}

- ${{ if ne(parameters.DotNetSdkVersion, '') }}:
- task: UseDotNet@2
displayName: 'Use specific .NET SDK version ${{ parameters.DotNetSdkVersion }}'
Expand Down

0 comments on commit 5ebb3e1

Please sign in to comment.