From fde8a5f20b350aec8fef17524d5e1a31f5550755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez=20Rinc=C3=B3n?= Date: Sat, 25 Dec 2021 02:24:28 +0100 Subject: [PATCH] Disable autoUpdate file generation for Linux and Mac --- electron-builder.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/electron-builder.js b/electron-builder.js index 3bd0c32..f1591fd 100644 --- a/electron-builder.js +++ b/electron-builder.js @@ -28,6 +28,14 @@ const fpmOptions = [ const combineTargetAndArch = (targets, architectures = ['x64', 'arm64']) => targets.map((target) => ({ target, arch: architectures })); +// realistically Auto Update only works for Windows +const getPublishProviders = (platform) => [ + { + provider: 'github', + publishAutoUpdate: platform === 'win', + }, +]; + module.exports = { asar: true, productName: productName, @@ -39,16 +47,13 @@ module.exports = { win: { icon: 'icon.ico', target: combineTargetAndArch(['nsis', 'zip'], ['x64']), - }, - nsis: { - installerIcon: 'icon.ico', - oneClick: false, - perMachine: false, + publish: getPublishProviders('win'), }, mac: { icon: 'icon.icns', category: 'public.app-category.productivity', target: combineTargetAndArch(['dmg', 'zip']), + publish: getPublishProviders('mac'), }, linux: { icon: 'icon.icns', @@ -60,6 +65,12 @@ module.exports = { StartupWMClass: productId, }, target: combineTargetAndArch(['AppImage', 'deb', 'rpm', 'pacman', 'zip']), + publish: getPublishProviders('linux'), + }, + nsis: { + installerIcon: 'icon.ico', + oneClick: false, + perMachine: false, }, deb: { fpm: fpmOptions, @@ -78,5 +89,4 @@ module.exports = { }, pacman: { fpm: fpmOptions }, rpm: { fpm: fpmOptions }, - publish: ['github'], };