Git Product home page Git Product logo

dotnet-packaging's Introduction

Packaging utilities for .NET Core

NuGet Build status

This repository contains command-line extensions for the .NET Core CLI which make it easy to create deployment packages (such as .zip files, tarballs or installers) for .NET Core applications.

The following commands are already available:

  • dotnet tarball - Create a .tar.gz file for Linux and OS X
  • dotnet rpm - Create a CentOS/RedHat Linux installer
  • dotnet zip - Create a .zip file
  • dotnet deb - Create a Ubuntu/Debian Linux installer

And these are up next:

  • dotnet pkg - Create a macOS installer
  • dotnet choco - Create a Chocolatey package
  • dotnet msi - Create a Windows Installer (msi) package

Did we miss anything? Feel free to file a feature request, or send a PR!

Installation

First, install the .NET Packaging tools. You don't need to install all tools if you only plan to use one.

dotnet tool install --global dotnet-zip
dotnet tool install --global dotnet-tarball
dotnet tool install --global dotnet-rpm
dotnet tool install --global dotnet-deb

Then, in your project directory, run dotnet {zip|tarball|rpm|deb} install to add the tool to your project:

dotnet zip install
dotnet tarball install
dotnet rpm install
dotnet deb install

Usage

From the command line, run dotnet rpm, dotnet zip or dotnet tarball to create a .rpm, .zip or .tar.gz archive of the published output of your project.

All commands take the following command line arguments:

  • -r, --runtime: The target runtime to build your project for. For example, win7-x64 or ubuntu.16.10-x64.
  • -f, --framework: The target framework to build your project for. For example, netcoreapp1.1 or net462.
  • -c, --configuration: Target configuration. The default for most projects is 'Debug'.
  • -o, --output: The output directory to place built packages in.
  • ---version-suffix: Defines the value for the $(VersionSuffix) property in the project.
  • --no-restore: Skip the implicit call to dotnet restore.

All arguments are optional.

Tutorial

Let's create a new console application and package it as a .deb file, so we can install it on our Ubuntu machine:

First, create your console application:

mkdir my-app
cd my-app
dotnet new console

Then, install the dotnet-deb utility:

dotnet tool install --global dotnet-deb
dotnet deb install

All set. Let's package your application as a deb package:

dotnet deb

There's now a bin\Debug\netcoreapp3.0\my-app.1.0.0.deb file wich you can install:

apt-get install bin\Debug\netcoreapp3.0\my-app.1.0.0.deb

Your application is installed into /usr/local/share/my-app. Invoke it by running /usr/local/share/my-app/my-app:

/usr/local/share/my-app/my-app

Note

You can invoke the packaging tools manually, using a MSBuild target instead of using the a .NET Core CLI tool:

dotnet msbuild [your-project].csproj /t:CreateZip /p:TargetFramework=netcoreapp1.1 /p:RuntimeIdentifier=win7-x64 /p:Configuration=Release

dotnet-packaging's People

Contributors

abatishchev avatar andreasdekiert avatar bartsaintgermain avatar daniel-sherwood avatar danielmoncada avatar darkneil14 avatar franklupo avatar gep13 avatar justarchi avatar kekekeks avatar nopara73 avatar qmfrederik avatar stop-cran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.