I was trying to set the package version using the following yml
, however I keep getting the error
##[error]No value was found for the provided environment variable.
when the dotnetcli task is executed.
trigger:
- master
name: 0.1.2-prerelease.$(Date:yyMM)$(DayOfMonth)$(Rev:rr)
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
nugetVersion: 0.1.2-prerelease.$(Date:yyMM)$(DayOfMonth)$(Rev:rr)
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '$(Build.SourcesDirectory)/src/**/*.csproj'
nobuild: true
versionEnvVar: '$(nugetVersion)'
versioningScheme: 'byEnvVar'