dotnet-releaser 0.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dotnet-releaser --version 0.1.4                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local dotnet-releaser --version 0.1.4                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-releaser&version=0.1.4                
nuke :add-package dotnet-releaser --version 0.1.4                

dotnet-releaser Build Status NuGet

<img align="right" width="160px" height="160px" src="https://raw.githubusercontent.com/xoofx/dotnet-releaser/main/img/dotnet-releaser.png">

dotnet-releaser is a command line tool to easily cross-compile, package and publish your .NET application to NuGet and GitHub.

Features

  • Cross-compile your .NET 6.0+ application to 9+ OS/CPU targets.
  • Create zip archives, Linux packages (debian, rpm) and Homebrew taps
  • Extract your changelog from your changelog.md
  • Publish all artifacts to NuGet and GitHub
  • Integrate dotnet-releaser easily in your GitHub Action workflow.

Defaults

By default, dotnet-releaser will cross-compile and package automatically the following targets:

  • NuGet package (packed as a .NET global tool)
  • [win-x64] with [zip] package
  • [win-arm] with [zip] package
  • [win-arm64] with [zip] package
  • [linux-x64] with [deb, tar] packages
  • [linux-arm] with [deb, tar] packages
  • [linux-arm64] with [deb, tar] packages
  • [rhel-x64] with [rpm, tar] packages
  • [osx-x64] with [tar] package
  • [osx-arm64] with [tar] package

When publishing, dotnet-releaser will automatically:

  • Publish your application as a global tool to NuGet
  • Upload all the package artifacts and your changelog to GitHub on the tag associated with your package version (e.g your package is 1.0.0, it will try to find a git tag v1.0.0 or 1.0.0).
  • Create a Homebrew repository and formula (e.g user_or_org/homebrew-your-app-name) for all the tar files associated with the targets for Linux and MacOS.

See the user guide on how to setup this differently for your application.

Getting started

1. Install dotnet-releaser

dotnet-releaser expects that .NET 6 SDK is installed.

Then you just need to install it as a global tool. Check the latest version!

dotnet tool install --global dotnet-releaser --version "0.1.*"

2. Create a TOM configuration file

You need to create a TOML configuration file that will instruct which project to build and package, and to which GitHub repository.

You can use dotnet-releaser new to create this configuration file.

Let's create a .NET HelloWorld project:

dotnet new console --name HelloWorld
cd HelloWorld
dotnet-releaser new --project HelloWorld.csproj

This will create a dotnet-releaser.toml. Replace the GitHub user/repository associated with the tool. You only need to specify them if you are going to publish to GitHub.

# configuration file for dotnet-releaser
[msbuild]
project = "HelloWorld.csproj"
[github]
user = "github_user_or_org_here"
repo = "github_repo_here"

3. Build

You can cross-compile and build all packages by running the sub-command build:

dotnet-releaser build --force dotnet-releaser.toml

It will create a sub folder artifacts-dotnet-releaser (Don't forget to add it to your .gitignore!) that will contain:

> ls artifacts-dotnet-releaser
HelloWorld.1.0.0.linux-arm.deb        
HelloWorld.1.0.0.linux-arm.tar.gz     
HelloWorld.1.0.0.linux-arm64.deb      
HelloWorld.1.0.0.linux-arm64.tar.gz   
HelloWorld.1.0.0.linux-x64.deb        
HelloWorld.1.0.0.linux-x64.tar.gz     
HelloWorld.1.0.0.nupkg                
HelloWorld.1.0.0.osx-arm64.tar.gz     
HelloWorld.1.0.0.osx-x64.tar.gz       
HelloWorld.1.0.0.rhel-x64.rpm         
HelloWorld.1.0.0.rhel-x64.tar.gz      
HelloWorld.1.0.0.win-arm.zip          
HelloWorld.1.0.0.win-arm64.zip        
HelloWorld.1.0.0.win-x64.zip          

4. Publish

The publish command allows to build and publish all packages to GitHub and NuGet.

dotnet-releaser publish --force --github-token YOUR_GITHUB_TOKEN_HERE --nuget-token YOUR_NUGET_TOKEN_HERE  dotnet-releaser.toml

For GitHub you need to create a personal access token

You should tick the public_repo in the list:

  • public_repo

And put an appropriate expiration date.

GitHub Setup of Personal access token

User Guide

For more details and advanced usages, please visit the user guide.

License

This software is released under the BSD-Clause 2 license.

Who is using dotnet-releaser?

It's brand new, so only the author for now! 😄

You can see it's usage on the project grpc-curl here.

Credits

dotnet-releaser is just a modest wrapper around many amazing OSS libraries:

Author

Alexandre Mutel aka xoofx.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.10.0 285 11/13/2024
0.9.0 3,365 5/6/2024
0.8.5 2,571 2/13/2024
0.8.4 772 2/9/2024
0.8.3 757 2/9/2024
0.8.2 773 2/8/2024
0.8.1 799 2/8/2024
0.8.0 685 2/8/2024
0.7.1 3,476 10/14/2023
0.7.0 1,408 10/7/2023
0.6.4 2,290 9/8/2023
0.6.3 5,556 3/8/2023
0.6.2 1,648 3/6/2023
0.6.1 2,873 11/14/2022
0.6.0 1,489 11/14/2022
0.5.2 1,966 10/20/2022
0.5.1 1,560 10/19/2022
0.5.0 1,780 9/5/2022
0.4.4 1,992 8/31/2022
0.4.3 1,581 8/28/2022
0.4.2 1,822 8/11/2022
0.4.1 2,534 5/7/2022
0.4.0 1,934 4/11/2022
0.3.14 1,985 3/7/2022
0.3.13 1,454 3/7/2022
0.3.12 1,719 3/6/2022
0.3.11 1,439 3/6/2022
0.3.10 1,662 3/6/2022
0.3.9 1,645 3/5/2022
0.3.8 1,566 3/5/2022
0.3.7 1,391 3/4/2022
0.3.6 1,668 3/3/2022
0.3.5 1,596 3/3/2022
0.3.4 1,366 3/1/2022
0.3.3 1,529 2/27/2022
0.3.2 1,644 2/27/2022
0.3.1 1,522 2/27/2022
0.3.0 1,582 2/27/2022
0.2.2 1,443 2/25/2022
0.2.1 1,455 2/25/2022
0.2.0 1,255 2/25/2022
0.1.12 1,537 2/8/2022
0.1.11 1,524 2/4/2022
0.1.10 1,483 2/4/2022
0.1.9 1,464 2/3/2022
0.1.8 1,369 2/3/2022
0.1.7 1,414 2/3/2022
0.1.6 1,627 2/2/2022
0.1.5 1,581 1/31/2022
0.1.4 1,509 1/31/2022
0.1.3 1,519 1/31/2022
0.1.2 1,497 1/31/2022
0.1.1 1,695 1/31/2022
0.1.0 1,681 1/29/2022