Teamcity Version based on branch

We use teamcity/github and no matter which way i format it i can’t get octopack to package it if I include the branch name in the package name.

Here are the setting I used in TeamCity:

Build Number Format: %vcsroot.branch%.1.0.0.%build.counter%
OctoPack package version: %build.number%

Error:
[14:18:11][CreateOctoPackPackage] error OCTONUGET: ‘master.1.0.0.17’ is not a valid version string.
[14:18:11][CreateOctoPackPackage] error OCTONUGET: Parameter name: version
[14:18:11][CreateOctoPackPackage] error OCT-1676060969: There was an error calling NuGet. Please see the output above for more details. Command line: ‘L:\Builds\BuildAgent3\work\99c6967a8a80cf20\packages\OctoPack.2.0.26\targets\NuGet.exe’ pack “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web\obj\octopacking\Service.Web.nuspec” -NoPackageAnalysis -BasePath “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web” -OutputDirectory “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web\obj\octopacked” -Version master.1.0.0.17
[14:18:11]
[CreateOctoPackPackage] error OCT-1676060969: System.Exception: There was an error calling NuGet. Please see the output above for more details. Command line: ‘L:\Builds\BuildAgent3\work\99c6967a8a80cf20\packages\OctoPack.2.0.26\targets\NuGet.exe’ pack “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web\obj\octopacking\Service.Web.nuspec” -NoPackageAnalysis -BasePath “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web” -OutputDirectory “L:\Builds\BuildAgent3\work\99c6967a8a80cf20\Service.Web\obj\octopacked” -Version master.1.0.0.17
at OctoPack.Tasks.CreateOctoPackPackage.RunNuGet(String specFilePath, String octopacking, String octopacked, String projectDirectory)
at OctoPack.Tasks.CreateOctoPackPackage.Execute()

Hi,

Try something like:

1.0.0.%build.counter%-%vcsroot.branch%

Example: 1.0.0.371-master

Regards,

Paul Stovell
Octopus Deploy
W: octopusdeploy.com | T: @octopusdeploy http://twitter.com/octopusdeploy

While this does work i can’t use that for distinguishing different deployments that I know of. I have 3 branches dev, release, master each of which would make its own package but I can’t quite figure out how to make the package IDs unique in naming so i can pick them up. With this method we wouldn’t use the promote scheme.