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 7, 2023
1 parent cae8dd6 commit a31e82f
Show file tree
Hide file tree
Showing 4 changed files with 1,188 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
# --- custom environment
NODE_VERSION:
type: string
default: "16.x"
default: "18.x"
VERBOSE:
type: string
default: "true"
Expand Down
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',
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/iconset',
categories: ['Utility'],
productDescription: LONG_DESCRIPTION,
requires: [
'util-linux',
],
},
}),
new MakerDeb({
options: {
name: 'balena-etcher',
icon: './assets/iconset',
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 a31e82f

Please sign in to comment.