Well, I think you have to use the command. Tbh I haven't actually done this myself before, but if you search "publish dotnet app" you should find some guides
Learn about the ways to publish a .NET application. .NET can publish platform-specific or cross-platform apps. You can publish an app as self-contained or as framework-dependent. Each mode affects how a user runs your app.