SuperJMN / DotnetPackaging

Easier packaging for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distribute your aplications!

Wondering how to distribute your wonderful .NET application to your fellow peeps? Bored to pack your stuff in a .zip that you hate as much as your users? You are in the correct place! With it, you can create your .deb packages for Debian based systems like Ubuntu and Debian itself. Woohoo!

Overview

One of the most flagrant annoyances of the .NET world is the absence of standardized ways to distribute "classic" applications, those that are for end users. Imagine that have a beautiful cross-platform application, like the ones created using Avalonia UI. Everything is fine until you need to distribute you apps.

DotnetPackageing has been created to give an answer to those that want to distribute their applications in a more convenient way. It's about time, uh?

How can I use this?

The application can be used as a library or as a .NET tool.

Using it as a .NET Tool

Easy peasy. Install the tool by executing this command:

dotnet tool install --global DotnetPackaging.Console

After the tool is installed, just invoke it with the appropriate arguments:

dotnetpackaging --directory c:\repos\myapp\bin\Release\net7.0\publish\linux-x64 --metadata C:\Users\JMN\Desktop\Testing\metadata.deb.json --output c:\users\jmn\desktop\testing\myapp.1.0.0.x64.deb
  • Wait, wait! I understand the --directory and --output options, but what's the json file?

it's a special file that you need to edit to customize the properties of your package.

Metadata.deb.json

This is a sample file. Customize it to your needs.

{
    "Executables": {
      "MyApp.Desktop": {
        "CommandName": "myapp",
        "DesktopEntry": {
          "Icons": {
            "32": "C:\\Users\\JMN\\Desktop\\Testing\\icon32.png",
            "64": "C:\\Users\\JMN\\Desktop\\Testing\\icon64.png"
          },
          "Name": "Sample application",
          "StartupWmClass": "Sample",
          "Keywords": [
            "Sample"
          ],
          "Comment": "This is a test",
          "Categories": [
            "Financial"
          ]
        }
      }
    },
    "PackageMetadata": {
      "Maintainer": "Some avid programmer",
      "PackageName": "SamplePackage",
      "ApplicationName": "Sample",
      "Architecture": "amd64",
      "Homepage": "https://www.sample.com",
      "License": "MIT",
      "Description": "Sample",
      "Version": "1.0.0"
    }
  }

Integrate it with Nuke Build system

AS I mentioned above, DotnetPackaging isn't just a tool, but a library, too. You can integrate it with Nuke very easily!

Take a looks to this example:

  1. https://github.com/SuperJMN/AvaloniaSyncer/blob/26260a6d2cc7c611d60e5c1e5b821f8512877ba5/build/Build.cs#L46
  2. https://github.com/SuperJMN/AvaloniaSyncer/blob/26260a6d2cc7c611d60e5c1e5b821f8512877ba5/build/DebPackages.cs#L16

Feel free to ask in the Discussions section of this repo. If this has been useful for you, please consider sponsoring this project. Thanks!

About

Easier packaging for .NET


Languages

Language:C# 94.4%Language:PowerShell 3.0%Language:Shell 2.4%Language:Batchfile 0.2%