diff --git a/.eslintrc.js b/.eslintrc.js index 7333aed0d..349b4d94f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,5 +59,6 @@ module.exports = { 'vite.config.ts', 'postcss.config.js', 'src/components/**/*.vue', // Incrementally fix these + 'electron-builder.ts', ], }; diff --git a/build/scripts/build.mjs b/build/scripts/build.mjs index b26ce6b70..779456d66 100644 --- a/build/scripts/build.mjs +++ b/build/scripts/build.mjs @@ -162,13 +162,6 @@ async function packageApp() { ...builderArgs, }; - /** - * electron-builder doesn't look for the APPLE_TEAM_ID environment variable for some reason. - * This workaround allows an environment variable to be added to the electron-builder.yml config - * collection. See: https://github.com/electron-userland/electron-builder/issues/7812 - */ - buildOptions.mac = { notarize: { teamId: process.env.APPLE_TEAM_ID || "" } } - await builder.build(buildOptions); } diff --git a/electron-builder.ts b/electron-builder.ts new file mode 100644 index 000000000..eae609346 --- /dev/null +++ b/electron-builder.ts @@ -0,0 +1,55 @@ +import type { Configuration } from 'electron-builder'; + +/** + * electron-builder doesn't look for the APPLE_TEAM_ID environment variable for some reason. + * This workaround allows an environment variable to be added to the electron-builder.yml config + * collection. See: https://github.com/electron-userland/electron-builder/issues/7812 + */ + +const config: Configuration = { + productName: 'Frappe Books', + appId: 'io.frappe.books', + asarUnpack: '**/*.node', + extraResources: [ + { from: 'log_creds.txt', to: '../creds/log_creds.txt' }, + { from: 'translations', to: '../translations' }, + { from: 'templates', to: '../templates' }, + ], + mac: { + type: 'distribution', + category: 'public.app-category.finance', + icon: 'build/icon.icns', + notarize: { + teamId: process.env.APPLE_TEAM_ID || '', + }, + hardenedRuntime: true, + gatekeeperAssess: false, + darkModeSupport: false, + entitlements: 'build/entitlements.mac.plist', + entitlementsInherit: 'build/entitlements.mac.plist', + publish: ['github'], + }, + win: { + publisherName: 'Frappe Technologies Pvt. Ltd.', + signDlls: true, + icon: 'build/icon.ico', + publish: ['github'], + target: ['portable', 'nsis'], + }, + nsis: { + oneClick: false, + perMachine: false, + allowToChangeInstallationDirectory: true, + installerIcon: 'build/installericon.ico', + uninstallerIcon: 'build/uninstallericon.ico', + publish: ['github'], + }, + linux: { + icon: 'build/icons', + category: 'Finance', + publish: ['github'], + target: ['deb', 'AppImage', 'rpm'], + }, +}; + +export default config; diff --git a/electron-builder.yml b/electron-builder.yml.disabled similarity index 94% rename from electron-builder.yml rename to electron-builder.yml.disabled index 1515e7fbc..03f7f285c 100644 --- a/electron-builder.yml +++ b/electron-builder.yml.disabled @@ -1,48 +1,48 @@ -productName: Frappe Books -appId: io.frappe.books -asarUnpack: '**/*.node' -extraResources: - [ - { from: 'log_creds.txt', to: '../creds/log_creds.txt' }, - { from: 'translations', to: '../translations' }, - { from: 'templates', to: '../templates' }, - ] -mac: - type: distribution - category: public.app-category.finance - icon: build/icon.icns - # notarize: - # appBundleId: io.frappe.books - hardenedRuntime: true - gatekeeperAssess: false - darkModeSupport: false - entitlements: build/entitlements.mac.plist - entitlementsInherit: build/entitlements.mac.plist - publish: - - github -win: - publisherName: Frappe Technologies Pvt. Ltd. - signDlls: true - icon: build/icon.ico - publish: - - github - target: - - portable - - nsis -nsis: - oneClick: false - perMachine: false - allowToChangeInstallationDirectory: true - installerIcon: build/installericon.ico - uninstallerIcon: build/uninstallericon.ico - publish: - - github -linux: - icon: build/icons - category: Finance - publish: - - github - target: - - deb - - AppImage - - rpm +productName: Frappe Books +appId: io.frappe.books +asarUnpack: '**/*.node' +extraResources: + [ + { from: 'log_creds.txt', to: '../creds/log_creds.txt' }, + { from: 'translations', to: '../translations' }, + { from: 'templates', to: '../templates' }, + ] +mac: + type: distribution + category: public.app-category.finance + icon: build/icon.icns + # notarize: + # appBundleId: io.frappe.books + hardenedRuntime: true + gatekeeperAssess: false + darkModeSupport: false + entitlements: build/entitlements.mac.plist + entitlementsInherit: build/entitlements.mac.plist + publish: + - github +win: + publisherName: Frappe Technologies Pvt. Ltd. + signDlls: true + icon: build/icon.ico + publish: + - github + target: + - portable + - nsis +nsis: + oneClick: false + perMachine: false + allowToChangeInstallationDirectory: true + installerIcon: build/installericon.ico + uninstallerIcon: build/uninstallericon.ico + publish: + - github +linux: + icon: build/icons + category: Finance + publish: + - github + target: + - deb + - AppImage + - rpm \ No newline at end of file