Skip to content

Instantly share code, notes, and snippets.

@dam5s
Created February 25, 2019 18:35
Show Gist options
  • Save dam5s/62cb988c3a5e5f9bc3c4ec66eb7fb07b to your computer and use it in GitHub Desktop.
Save dam5s/62cb988c3a5e5f9bc3c4ec66eb7fb07b to your computer and use it in GitHub Desktop.
How to publish a .NET Core CLI as a single binary for all 3 platforms from a single OS.
#!/bin/bash
set -e
set -v
dotnet publish -c release -r linux-x64
warp-packer --arch linux-x64 --input_dir cli-app/bin/Release/netcoreapp2.2/linux-x64/publish --exec cli-app --output cli-app/bin/Release/netcoreapp2.2/cli-app-linux
dotnet publish -c release -r osx-x64
warp-packer --arch macos-x64 --input_dir cli-app/bin/Release/netcoreapp2.2/osx-x64/publish --exec cli-app --output cli-app/bin/Release/netcoreapp2.2/cli-app-osx
dotnet publish -c release -r win-x64
warp-packer --arch windows-x64 --input_dir cli-app/bin/Release/netcoreapp2.2/win-x64/publish --exec cli-app.exe --output cli-app/bin/Release/netcoreapp2.2/cli-app-win.exe
@dam5s
Copy link
Author

dam5s commented Feb 25, 2019

warp-packer comes from the Warp project: https://github.com/dgiagio/warp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment