2020-02-16 19:30:00 +01:00
|
|
|
const os = require('os')
|
|
|
|
const builder = require('electron-builder')
|
|
|
|
|
|
|
|
const Platform = builder.Platform
|
2020-07-21 23:43:52 +02:00
|
|
|
const Arch = builder.Arch
|
2020-02-16 19:30:00 +01:00
|
|
|
const { name, productName } = require('../package.json')
|
2020-07-21 23:43:52 +02:00
|
|
|
const args = process.argv
|
2020-02-16 19:30:00 +01:00
|
|
|
|
|
|
|
let targets
|
2022-05-14 18:53:08 +02:00
|
|
|
const platform = os.platform()
|
2020-02-16 19:30:00 +01:00
|
|
|
|
2022-05-14 18:53:08 +02:00
|
|
|
if (platform === 'darwin') {
|
|
|
|
let arch = Arch.x64
|
|
|
|
|
2022-09-06 23:18:29 +02:00
|
|
|
if (args[2] === 'arm64') {
|
2022-05-14 18:53:08 +02:00
|
|
|
arch = Arch.arm64
|
|
|
|
}
|
2022-09-26 22:17:04 +02:00
|
|
|
|
2022-09-10 16:24:22 +02:00
|
|
|
targets = Platform.MAC.createTarget(['DMG','zip', '7z'], arch)
|
2022-05-14 18:53:08 +02:00
|
|
|
} else if (platform === 'win32') {
|
2022-09-06 23:18:29 +02:00
|
|
|
let arch = Arch.x64
|
|
|
|
|
|
|
|
if (args[2] === 'arm64') {
|
|
|
|
arch = Arch.arm64
|
|
|
|
}
|
2022-09-26 22:17:04 +02:00
|
|
|
|
2022-09-10 16:24:22 +02:00
|
|
|
targets = Platform.WINDOWS.createTarget(['nsis', 'zip', '7z', 'portable'], arch)
|
2022-05-14 18:53:08 +02:00
|
|
|
} else if (platform === 'linux') {
|
2020-07-21 23:43:52 +02:00
|
|
|
let arch = Arch.x64
|
|
|
|
|
2021-03-06 17:19:54 +01:00
|
|
|
if (args[2] === 'arm64') {
|
2020-07-21 23:43:52 +02:00
|
|
|
arch = Arch.arm64
|
|
|
|
}
|
|
|
|
|
2021-04-22 00:11:52 +02:00
|
|
|
if (args[2] === 'arm32') {
|
2021-03-06 17:19:54 +01:00
|
|
|
arch = Arch.armv7l
|
|
|
|
}
|
|
|
|
|
2022-09-10 16:24:22 +02:00
|
|
|
targets = Platform.LINUX.createTarget(['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'], arch)
|
2020-02-16 19:30:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
appId: `io.freetubeapp.${name}`,
|
2022-12-31 13:30:43 +01:00
|
|
|
copyright: 'Copyleft © 2020-2023 freetubeapp@protonmail.com',
|
2020-02-16 19:30:00 +01:00
|
|
|
// asar: false,
|
|
|
|
// compression: 'store',
|
2020-03-24 14:22:29 +01:00
|
|
|
productName,
|
2020-02-16 19:30:00 +01:00
|
|
|
directories: {
|
|
|
|
output: './build/',
|
|
|
|
},
|
2020-10-04 22:31:07 +02:00
|
|
|
protocols: [
|
|
|
|
{
|
|
|
|
name: "FreeTube",
|
|
|
|
schemes: [
|
|
|
|
"freetube"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2022-07-14 16:43:07 +02:00
|
|
|
files: [
|
|
|
|
'_icons/iconColor.*',
|
|
|
|
'icon.svg',
|
|
|
|
'./dist/**/*',
|
|
|
|
'!dist/web/*',
|
2022-09-06 04:29:10 +02:00
|
|
|
'!node_modules/**/*',
|
2022-07-14 16:43:07 +02:00
|
|
|
],
|
2020-02-16 19:30:00 +01:00
|
|
|
dmg: {
|
|
|
|
contents: [
|
|
|
|
{
|
|
|
|
path: '/Applications',
|
|
|
|
type: 'link',
|
|
|
|
x: 410,
|
|
|
|
y: 230,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'file',
|
|
|
|
x: 130,
|
|
|
|
y: 230,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
window: {
|
|
|
|
height: 380,
|
|
|
|
width: 540,
|
2020-10-10 03:05:03 +02:00
|
|
|
}
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
|
|
|
linux: {
|
2020-03-25 09:05:40 +01:00
|
|
|
category: 'Network',
|
2021-03-06 23:17:06 +01:00
|
|
|
icon: '_icons/icon.svg',
|
2022-09-10 16:24:22 +02:00
|
|
|
target: ['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'],
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
2021-05-23 04:52:50 +02:00
|
|
|
// See the following issues for more information
|
|
|
|
// https://github.com/jordansissel/fpm/issues/1503
|
|
|
|
// https://github.com/jgraph/drawio-desktop/issues/259
|
|
|
|
rpm: {
|
|
|
|
fpm: [`--rpm-rpmbuild-define=_build_id_links none`]
|
|
|
|
},
|
2021-04-24 19:41:07 +02:00
|
|
|
deb: {
|
|
|
|
depends: [
|
|
|
|
"libgtk-3-0",
|
|
|
|
"libnotify4",
|
|
|
|
"libnss3",
|
|
|
|
"libxss1",
|
|
|
|
"libxtst6",
|
|
|
|
"xdg-utils",
|
|
|
|
"libatspi2.0-0",
|
|
|
|
"libuuid1",
|
|
|
|
"libsecret-1-0"
|
|
|
|
]
|
|
|
|
},
|
2020-02-16 19:30:00 +01:00
|
|
|
mac: {
|
|
|
|
category: 'public.app-category.utilities',
|
2021-03-07 02:41:26 +01:00
|
|
|
icon: '_icons/iconMac.icns',
|
2022-09-10 16:24:22 +02:00
|
|
|
target: ['dmg', 'zip', '7z'],
|
2020-02-16 19:30:00 +01:00
|
|
|
type: 'distribution',
|
2020-10-10 03:09:23 +02:00
|
|
|
extendInfo: {
|
|
|
|
CFBundleURLTypes: [
|
|
|
|
'freetube'
|
|
|
|
],
|
|
|
|
CFBundleURLSchemes: [
|
|
|
|
'freetube'
|
|
|
|
]
|
|
|
|
}
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
|
|
|
win: {
|
2021-03-06 23:17:06 +01:00
|
|
|
icon: '_icons/icon.ico',
|
2022-09-10 16:24:22 +02:00
|
|
|
target: ['nsis', 'zip', '7z', 'portable'],
|
2020-02-16 19:30:00 +01:00
|
|
|
},
|
|
|
|
nsis: {
|
|
|
|
allowToChangeInstallationDirectory: true,
|
|
|
|
oneClick: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
builder
|
|
|
|
.build({
|
|
|
|
targets,
|
|
|
|
config,
|
2022-08-12 02:35:26 +02:00
|
|
|
publish: 'never'
|
2020-02-16 19:30:00 +01:00
|
|
|
})
|
|
|
|
.then(m => {
|
|
|
|
console.log(m)
|
|
|
|
})
|
|
|
|
.catch(e => {
|
|
|
|
console.error(e)
|
|
|
|
})
|