From 5646d329db09aa19550543c9b1b82874006f0965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez=20Rinc=C3=B3n?= Date: Tue, 21 Sep 2021 22:50:22 +0200 Subject: [PATCH 1/2] Include arm64 arch for linux builds --- electron-builder.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/electron-builder.js b/electron-builder.js index 38e4744..f0c3166 100644 --- a/electron-builder.js +++ b/electron-builder.js @@ -26,6 +26,10 @@ const fpmOptions = [ `--conflicts=${conflictProductId}`, ]; +const combineTargetAndArch = (targets, architectures = ['x64', 'arm64']) => ( + targets.map(target => ({ target, arch: architectures })) +); + module.exports = { asar: editionEnvVar === 'vanilla', productName: productName, @@ -36,7 +40,7 @@ module.exports = { protocols: [{ name: 'Notion', schemes: ['notion'] }], win: { icon: 'icon.ico', - target: ['nsis', 'zip'], + target: combineTargetAndArch(['nsis', 'zip'], ['x64']), }, nsis: { installerIcon: 'icon.ico', @@ -46,16 +50,7 @@ module.exports = { mac: { icon: 'icon.icns', category: 'public.app-category.productivity', - target: [ - { - target: 'dmg', - arch: ['x64', 'arm64'], - }, - { - target: 'zip', - arch: ['x64', 'arm64'], - }, - ], + target: combineTargetAndArch(['dmg', 'zip']), }, linux: { icon: 'icon.icns', @@ -66,7 +61,7 @@ module.exports = { StartupNotify: 'true', StartupWMClass: productId, }, - target: ['AppImage', 'deb', 'rpm', 'pacman', 'zip'], + target: combineTargetAndArch(['AppImage', 'deb', 'rpm', 'pacman', 'zip']), }, deb: { fpm: fpmOptions }, pacman: { fpm: fpmOptions }, From 8b913b1b8b1ae0842dffb77b984ab7c453323c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez=20Rinc=C3=B3n?= Date: Tue, 21 Sep 2021 22:52:32 +0200 Subject: [PATCH 2/2] Consistent vanilla check in builder config --- electron-builder.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/electron-builder.js b/electron-builder.js index f0c3166..8ac1eff 100644 --- a/electron-builder.js +++ b/electron-builder.js @@ -15,10 +15,9 @@ const isVanilla = editionEnvVar === 'vanilla'; const productName = isVanilla ? 'Notion' : 'Notion Enhanced', productId = isVanilla ? 'notion-app' : 'notion-app-enhanced', conflictProductId = !isVanilla ? 'notion-app' : 'notion-app-enhanced', - productDescription = - editionEnvVar === 'vanilla' - ? 'The all-in-one workspace for your notes and tasks' - : 'The all-in-one workspace for your notes and tasks, but enhanced'; + productDescription = isVanilla + ? 'The all-in-one workspace for your notes and tasks' + : 'The all-in-one workspace for your notes and tasks, but enhanced'; const fpmOptions = [ `--version=${versionEnvVar}`, @@ -26,12 +25,11 @@ const fpmOptions = [ `--conflicts=${conflictProductId}`, ]; -const combineTargetAndArch = (targets, architectures = ['x64', 'arm64']) => ( - targets.map(target => ({ target, arch: architectures })) -); +const combineTargetAndArch = (targets, architectures = ['x64', 'arm64']) => + targets.map((target) => ({ target, arch: architectures })); module.exports = { - asar: editionEnvVar === 'vanilla', + asar: isVanilla, productName: productName, extraMetadata: { description: productDescription,