MacOsPublish 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global MacOsPublish --version 1.0.0
                    
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 MacOsPublish --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=MacOsPublish&version=1.0.0
                    
nuke :add-package MacOsPublish --version 1.0.0
                    

MacOsPublish

MacOsPublish is a command-line tool to build, bundle, codesign, and optionally notarize .NET macOS applications in a unified .app bundle that includes both x64 and arm64 binaries.


🛠️ Installation

To install MacOsPublish as a global .NET tool:

dotnet tool install --global MacOsPublish

Or update:

dotnet tool update --global MacOsPublish

You can also install it locally in your project:

dotnet tool install MacOsPublish

To check if the tool is available:

MacOsPublish --help

🧱 Bundle Structure Generated

YourApp.app
└── Contents
    ├── MacOS
    │   ├── osx-arm64/         <- your arm64 build
    │   ├── osx-x64/           <- your x64 build
    │   ├── shared/            <- shared binaries (deduplicated)
    │   └── YourApp.sh         <- launcher script (auto-detects CPU arch)
    ├── Resources/             <- assets (icons, images, etc.)
    └── Info.plist

⚙️ Usage

MacOsPublish <PROJECT> [<OUTPUT_DIR>] [<SIGNING_IDENTITY>] [<INSTALLER_IDENTITY>] [--notarize <PROFILE>] [--no-restore]

Arguments

Argument Description
<PROJECT> Path to .csproj or .sln file.
[OUTPUT_DIR] Destination output folder (default: bin/UniversalBundleApp).
[SIGNING_IDENTITY] Apple Developer identity. Empty to skip code signing.
[INSTALLER_IDENTITY] Apple Installer identity (used for .pkg generation).
--notarize <PROFILE> Submit the .dmg to Apple Notary Service. Requires xcrun notarytool.
--no-restore Skip dotnet restore.
-h, --help Display help.

🔐 Notarization Setup

To notarize your app, first store your credentials:

xcrun notarytool store-credentials --apple-id <email> --team-id <TEAM_ID> --password <app-password> --keychain-profile "MacOsPublishProfile"

You can then use:

macospublish YourApp.csproj --notarize MacOsPublishProfile

🔗 Example

macospublish MyApp.csproj publish/MyApp "Developer ID Application: Your Name (TEAMID)" "Developer ID Installer: Your Name (TEAMID)" --notarize MacOsPublishProfile

🧠 Features

  • ✅ Supports both osx-arm64 and osx-x64
  • ✅ Parallel builds
  • ✅ Deduplicates shared files (using SHA-256)
  • ✅ Creates .app, .pkg, and .dmg
  • ✅ Optional Apple notarization and stapling
  • ✅ Symbolic links to shared files
  • .DS_Store cleanup
  • ✅ Automatic architecture launcher script

📦 Requirements

  • .NET SDK
  • macOS with:
    • xcrun
    • codesign
    • productbuild
    • hdiutil

📄 License

MIT License — (C) 2025 Castello Branco Technologia LTDA

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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
1.5.1 128 3/14/2025
1.5.0 128 3/14/2025
1.2.5 135 3/13/2025
1.2.2 134 3/13/2025
1.2.1 133 3/13/2025
1.2.0 131 3/13/2025
1.1.4 133 3/13/2025
1.1.3 133 3/13/2025
1.1.2 128 3/13/2025
1.1.1 132 3/13/2025
1.1.0 134 3/13/2025
1.0.5 144 3/12/2025
1.0.2 141 3/12/2025
1.0.0 155 3/11/2025