Skip to content

Commit

Permalink
Merge pull request #822 from frappe/electron_builder_file_update
Browse files Browse the repository at this point in the history
Updating electron-builder to a ts file
  • Loading branch information
Isaac-GC authored Jan 25, 2024
2 parents f90143a + 93855d7 commit de2ae58
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 55 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ module.exports = {
'vite.config.ts',
'postcss.config.js',
'src/components/**/*.vue', // Incrementally fix these
'electron-builder.ts',
],
};
7 changes: 0 additions & 7 deletions build/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
55 changes: 55 additions & 0 deletions electron-builder.ts
Original file line number Diff line number Diff line change
@@ -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;
96 changes: 48 additions & 48 deletions electron-builder.yml → electron-builder.yml.disabled
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit de2ae58

Please sign in to comment.