build(desktop): dynamically configure target formats based on host OS (#4796)

This commit is contained in:
James Rich
2026-03-14 09:38:34 -05:00
committed by GitHub
parent b63192dccc
commit 609d24a9e4
2 changed files with 10 additions and 3 deletions

View File

@@ -310,6 +310,7 @@ jobs:
desktop/build/compose/binaries/main-release/*/*.exe
desktop/build/compose/binaries/main-release/*/*.deb
desktop/build/compose/binaries/main-release/*/*.rpm
desktop/build/compose/binaries/main-release/*/*.AppImage
retention-days: 1
if-no-files-found: ignore

View File

@@ -78,19 +78,25 @@ compose.desktop {
// notarize = true
// appleID = System.getenv("APPLE_ID")
// appStorePassword = System.getenv("APPLE_APP_SPECIFIC_PASSWORD")
targetFormats(TargetFormat.Dmg)
}
windows {
iconFile.set(project.file("src/main/resources/icon.ico"))
menuGroup = "Meshtastic"
// TODO: Must generate and set a consistent UUID for Windows upgrades.
// upgradeUuid = "YOUR-UPGRADE-UUID-HERE"
targetFormats(TargetFormat.Msi, TargetFormat.Exe)
}
linux {
iconFile.set(project.file("src/main/resources/icon.png"))
menuGroup = "Network"
targetFormats(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
}
// Define target formats based on the current host OS to avoid configuration errors
// (e.g., trying to configure Linux AppImage notarization on macOS).
val currentOs = System.getProperty("os.name").lowercase()
when {
currentOs.contains("mac") -> targetFormats(TargetFormat.Dmg)
currentOs.contains("win") -> targetFormats(TargetFormat.Msi, TargetFormat.Exe)
else -> targetFormats(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
}
// Read version from project properties (passed by CI) or default to 1.0.0