mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Command line publishing #1015
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @markatosi on GitHub (Nov 19, 2025).
I have read the new Package build wiki and it looks as though publishing should be fine as long as you are within the VS Studio world. I don't see any guidance regarding publishing an app bundle from the command line. Is that just gone or am I missing something?
I have a software for which use need to build a universal binary on a Mac (Arm + intel glued together)
I have written a js script to do this but it is dependent on being able to build the .app files from the command line in a certain order perform a lot of other maintenance on the binaries to make sure the two apps can be successfully combined.
I will provide a relevant excerpt of the script.
Step 2 is the important bit but it's critical that each step flow one after the other.
(I'm using electron sharp right now as it was the only reasonable way to build an apple mac store app as the old version of electron net didn't easily/semi officially support newer versions of electron and electron builder and it was impossible to create an app bundle that could be successfully approved and or notarized for distribution)
@softworkz commented on GitHub (Nov 19, 2025):
Command line publishing is working. My own project is using the new Electron.NET Core and our Linux packages are built on Azure DevOps. This is directly from the log (just stripped loggers):
dotnet publish xxx.csproj -c Release -p:Platform=x64 -r linux-x64 -p:PublishProfile=publish-linux-x64 -p:Version=2.268.0I haven't tried without publish profile yet, but you can take one from the repo here. Or just specify the variables on the command line directly - there's no forcing reading to use publishing profile files.
Summary
Yes, it'sabsolutely possible. You just don't use any special CLI tool anymore but simply dotnet publish .
@softworkz commented on GitHub (Nov 19, 2025):
Furthermore, you'll probably able to collapse steps 1, 2, 3, 4 and 5 into a single operation, running
dotnet publishwith publish settings for self-contained and single-file should give you that result already.Please note that electron-builder settings are no longer in a package.json but in an "original" electron-builder.json file (
./Propertiesfolder).We have the integration tests running on Mac as well (e.g. https://github.com/ElectronNET/Electron.NET/actions/runs/19486228327), so
dotnet buildanddotnet testare definitley working on mac.@FlorianRappl commented on GitHub (Nov 19, 2025):
Wanted to write the same as @softworkz . It's just a single command, and it's the "standard" command (
dotnet publish). No extras required.Hope that helps!
@markatosi commented on GitHub (Nov 21, 2025):
I was able to whittle my universal binary script from 10 to 3 steps and remove tons of now unnecessary code. I may contribute this script to the project... if you think it would be helpful. Even with the massive improvements with Electron Net build process making a working universal binary with .net and electron is still not remotely obvious.