How to Create and Publish NuGet Packages Using .NET Core CLI

In my previous post on CLI tools, I explained how to create, restore, clean, build, and run a .NET Core application using the latest CLI commands. You can find that post here.
In this post, we will learn how to create and publish NuGet packages using CLI commands.