I am trying to get one pipeline to both build and test my code, and in another stage to pack and push a nuget package.
name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.r)trigger: branches: include: - 'master' paths: exclude: - deploy/*stages:# Build, test and package for deployment- template: deploy/build/stage.yaml- template: deploy/build/nuget.yaml
The pipeline fails in the last stage, on packing the nuget file.
##[error]Could not find version number data in the following environment variable: BUILD_BUILDNUMBER. The value of the variable should contain a substring with the following formats: X.Y.Z or X.Y.Z.A where A, X, Y, and Z are positive integers.
I understand that in the outer yaml file where the "name" is part of the underlying versioning scheme, is part of the error here. But can I somehow in my nuget.yaml override the outer "name" attribute ?
In the nuget.yaml file I am doing this (sorry for the formatting)
variables: buildConfiguration: 'Release' majorMinorVersion: 1.2 # semanticVersion counter is automatically incremented by one in each execution of pipeline # second parameter is seed value to reset to every time the referenced majorMinorVersion is changed semanticVersion: $[counter(variables['majorMinorVersion'], 0)] - task: DotNetCoreCLI@2 displayName: 'dotnet pack' inputs: command: pack projects: src/**/*.csproj versioningScheme: byBuildNumber
The nuget.yaml file runs fine by itself when it's not part of a a multi-stage pipeline.