Skip to content

Commit

Permalink
Define packaging targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dfunckt committed Nov 9, 2023
1 parent 06a22a7 commit 478a7a8
Show file tree
Hide file tree
Showing 3 changed files with 1,187 additions and 1 deletion.
120 changes: 119 additions & 1 deletion forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,136 @@ import { MakerSquirrel } from '@electron-forge/maker-squirrel';
import { MakerZIP } from '@electron-forge/maker-zip';
import { MakerDeb } from '@electron-forge/maker-deb';
import { MakerRpm } from '@electron-forge/maker-rpm';
import { MakerDMG } from '@electron-forge/maker-dmg';
import { MakerAppImage } from '@reforged/maker-appimage';
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
import { WebpackPlugin } from '@electron-forge/plugin-webpack';

import { mainConfig, rendererConfig } from './webpack.config';

const LONG_DESCRIPTION = `balenaEtcher is a powerful OS image flasher built with
web technologies to ensure flashing an SDCard or USB drive is a pleasant and safe
experience. It protects you from accidentally writing to your hard-drives, ensures
every byte of data was written correctly and much more.`;

const config: ForgeConfig = {
packagerConfig: {
asar: true,
icon: './assets/icon',
executableName: process.platform === 'linux' ? 'balena-etcher' : 'balenaEtcher',
appBundleId: 'io.balena.etcher',
appCategoryType: 'public.app-category.developer-tools',
appCopyright: 'Copyright 2016-2023 Balena Ltd',
darwinDarkModeSupport: true,
protocols: [
{ name: 'etcher', schemes: ['etcher']},
],

// osxSign: {},
// osxNotarize: {},

// One or more files to be copied directly into the app's `Contents/Resources` directory
// for macOS target platforms, and the `resources` directory for other target platforms.
// The resources directory can be referenced in code via `process.resourcesPath`.
extraResource: [
// TODO: child writer
],
},
rebuildConfig: {},
makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})],
makers: [
new MakerZIP(),
new MakerSquirrel({
setupIcon: 'assets/icon.ico',
}),
new MakerDMG({
background: './assets/dmg/background.tiff',
icon: './assets/icon.icns',
iconSize: 110,
contents: ((opts: { appPath: string }) => {
return [
{ x: 140, y: 250, type: 'file', path: opts.appPath },
{ x: 415, y: 250, type: 'link', path: '/Applications' }
]
}) as any, // type of MakerDMGConfig omits `appPath`
additionalDMGOptions: {
window: {
size: {
width: 540,
height: 425,
},
position: {
x: 400,
y: 500,
}
}
}
}),
new MakerAppImage({
options: {
icon: './assets/icon.png',
categories: ['Utility'],
}
}),
new MakerRpm({
options: {
icon: './assets/icon.png',
categories: ['Utility'],
productDescription: LONG_DESCRIPTION,
requires: [
'util-linux',
],
},
}),
new MakerDeb({
options: {
icon: './assets/icon.png',
categories: ['Utility'],
section: 'utils',
priority: 'optional',
productDescription: LONG_DESCRIPTION,
scripts: {
postinst: './after-install.tpl',
},
depends: [
'gconf-service',
'gconf2',
'libasound2',
'libatk1.0-0',
'libc6',
'libcairo2',
'libcups2',
'libdbus-1-3',
'libexpat1',
'libfontconfig1',
'libfreetype6',
'libgbm1',
'libgcc1',
'libgconf-2-4',
'libgdk-pixbuf2.0-0',
'libglib2.0-0',
'libgtk-3-0',
'liblzma5',
'libnotify4',
'libnspr4',
'libnss3',
'libpango1.0-0 | libpango-1.0-0',
'libstdc++6',
'libx11-6',
'libxcomposite1',
'libxcursor1',
'libxdamage1',
'libxext6',
'libxfixes3',
'libxi6',
'libxrandr2',
'libxrender1',
'libxss1',
'libxtst6',
'polkit-1-auth-agent | policykit-1-gnome | polkit-kde-1',
],
}
}),
],
plugins: [
new AutoUnpackNativesPlugin({}),
new WebpackPlugin({
Expand Down
Loading

0 comments on commit 478a7a8

Please sign in to comment.