Adding files to published NuGet package in TeamCity

We use TeamCity to publish a NuGet package and have the option “If checked, any projects with OctoPack installed will be packaged.” on the MSBuild buildstep.

Now in the project “General Settings” I have in “Artifact paths” the following path: “/**/*.css”.

But when the build completes I end up with a NuGet package that doesn’t contain any of the CSS files, but instead I get what is attached.

Is there a way to get the artifacts in the nuget package? This is just a test, soon we want to switch over to a complete Gulp packaging by copying files in a dist folder before publishing the package.

Would it be better to generate the NuGet manually with the NuGet Pack build step?

Hi there,

Thanks for reaching out!

Since the file is not part of the project/solution, Octopack doesn’t recognize it. Octopack is a bit more clever than just “pack whatever is in X directory”, but in this case that cleverness is playing against us.

What you can do is follow the logic of this doc, but for your CSS files: http://docs.octopusdeploy.com/display/OD/OctoPack+to+include+BuildEvent+files . This should help you adding the files to your Nuget package.

Sit tight with patience though. Dealing directly with nuspec files never works on the first try (for that reason we made Octopack so smart).

Hope that helps!
Dalmiro