Add ability to pass an argument for "Version" for both the "dotnet publish" and "electron-builder" commands #638

Closed
opened 2026-01-29 16:44:57 +00:00 by claunia · 1 comment
Owner

Originally created by @tub5 on GitHub (Feb 22, 2021).

As I'm using Azure DevOps to build the electron app I would like to be able to pass the version of the app as an argument to both the argument for dotnet publish and electron-builder processes. By adding in the /Version argument it will be possible to update both of these via the build pipeline. In regards to the electrion-builder process, if the /Version argument is provided and there is a value for buildVersion then the /Version value will take precedence.

Originally created by @tub5 on GitHub (Feb 22, 2021). As I'm using Azure DevOps to build the electron app I would like to be able to pass the version of the app as an argument to both the argument for `dotnet publish` and `electron-builder` processes. By adding in the `/Version` argument it will be possible to update both of these via the build pipeline. In regards to the `electrion-builder` process, if the `/Version` argument is provided and there is a value for `buildVersion` then the `/Version` value will take precedence.
claunia added the Feature label 2026-01-29 16:44:57 +00:00
Author
Owner

@BenjaminVettori commented on GitHub (Feb 24, 2021):

I had the same idea and just saw you already created a PR.
This will provide the ability to use e.g. gitversion to do the versioning automatically instead of having to update the manifest file with a script.

My workaround was the following powershell script, but the extra /Version argument is much more convenient

$manifest = Get-Content './electron.manifest.json' -raw | ConvertFrom-Json
$buildVersion = $manifest.build.buildVersion
$gitVersion = gitversion | ConvertFrom-Json
$manifest.build.buildVersion = $gitVersion.SemVer
$manifest | ConvertTo-Json -depth 32 | set-content './electron.manifest.json'
try {
	electronize build /target win
} finally {
	$manifest.build.buildVersion = $buildVersion
	$manifest | ConvertTo-Json -depth 32 | set-content './electron.manifest.json'
}
@BenjaminVettori commented on GitHub (Feb 24, 2021): I had the same idea and just saw you already created a PR. This will provide the ability to use e.g. gitversion to do the versioning automatically instead of having to update the manifest file with a script. My workaround was the following powershell script, but the extra /Version argument is much more convenient ``` $manifest = Get-Content './electron.manifest.json' -raw | ConvertFrom-Json $buildVersion = $manifest.build.buildVersion $gitVersion = gitversion | ConvertFrom-Json $manifest.build.buildVersion = $gitVersion.SemVer $manifest | ConvertTo-Json -depth 32 | set-content './electron.manifest.json' try { electronize build /target win } finally { $manifest.build.buildVersion = $buildVersion $manifest | ConvertTo-Json -depth 32 | set-content './electron.manifest.json' } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#638