问题
There is a known problem that if you deploy during a TeamCity build, a previous version will be deployed (as the current will be available only after the build is finished).
Documentation suggests creating a secondary TeamCity BuildConfiguration as a workaround but it sucks and seems not to work anymore (there is a number of bug reports about it).
There was an alternative solution suggested in the comments to this question. The idea is to push your current build nuget package to the Octopus nuget server (and deploy based on it instead of TeamCity nuget feed).
So I've created a NuGet Publish build step, specified Api Key and Package Source but I have no idea what to specify in Packages field. In other words, what is the path to a freshly created nuget package for my build?
回答1:
OctoPack creates the .nupkg file in a subdirectory \obj\octopacked\ of the project that contains the .nuspec file
回答2:
It's described here. Specify a newline-separated list of NuGet package files (.nupkg) to publish to the NuGet feed. List packages individually or use wildcards.
The path to the newly created package file will depend on how your build is setup. But you can try a wildcard like **/*.nupkg and it will find all nupkg files in your build folder structure.
来源:https://stackoverflow.com/questions/30012948/publish-nuget-package-during-teamcity-build-to-octopus