Thanks for getting in touch. We don’t currently have any pre-built solutions, however something I did with one of our apps was
dotnet publish to a folder, and then
dotnet pack that folder with a new
project.json that is just set to bundle up the whole folder.
In my example I have a file called pack.json which gets copyed to the publish folder on publish and renamed to
project.json. So in the original
project.json we have:
"project.json": "pack.json" //<---- this line copies pack.json in our source folder to our publish folder and renames it to project.json
pack.json file is a fully valid
project.json file that is used to build the actual nuget package and has options set to just include (almost) everything:
"exclude": [ "project.json", "FSharp/*.xml", "ScriptCS/*.ps1" ]
Since it is only used to bundle your app up and not to build it, it only needs to include information used in the pack step.
So your process looks something like:
dotnet publish path\to\application\project.json -f netcoreapp1.0 --output path\to\published\app
dotnet pack path\to\published\app\project.json -f netcoreapp1.0
I might be missing some flags to the dotnet commands there, but hopefully you get the idea.
You can see this in action in our open source Calamari library here. There is a little extra complexity there because we’re building that app for .NET Core and .NET 4. I haven’t tried this in TeamCity as we’ve started using Cake build scripts to handle this sort of thing, but have used their .NET Core plugin and think it should work as a two step process.
I hope that helps, let me know how you go.