We have a dev branch and a master branch.
Dev is going to development, master is going to staging currently.
Both are built in Teamcity and OctoPack runs automatically to generate the NuGet packages. The issue is that they both generate the same name for NuGet which causes Octopus to always get the ‘latest’.
How do I generate different output for development and staging?
We faced similar challenges in our environment.
At our company we use the master and featurebranches principle (which means we tend to have lots of different branches)
I altered the Octopack.targets file a bit so that when I add the branchname to the msbuild arguments in the build definition octopack generates a pre release package when the branch that is being built is not the main branch.
This way the only branch that generates non pre release versions is the main branch. All the featurebranches generate packages with a pre release version using this version format. x.y.z.rev-branchname (e.g. 1.0.5123.1-AddedFancyPants)
This works fine. The only downside is that octopus currently ignores the release/pre release status and thus does not disregard pre release versions in the “latest version” column when creating a new release. So you have to use the specific version picker and figure out the latest non pre release version yourself when creating a release for the main branch.