diff --git a/package.json b/package.json index c40ffcc5c..79378531d 100644 --- a/package.json +++ b/package.json @@ -73,10 +73,8 @@ "buildMacIntel": "npm run build && node ./scripts/buildMac.js --platform=x86", "buildMacArm": "npm run build && node ./scripts/buildMac.js --platform=arm64", "buildDebian": "npm run build && node ./scripts/buildDebian.js --platform=amd64", - "buildRaspi": "npm run build && node ./scripts/buildDebian.js --platform=armhf", - "buildLinuxArm64": "npm run build && node ./scripts/buildDebian.js --platform=arm64", "buildRedhat": "npm run build && node ./scripts/buildRedhat.js", - "buildAll": "npm run buildWindows && npm run buildMacIntel && npm run buildMacArm && npm run buildDebian && npm run buildRedhat && npm run buildRaspi && npm run buildLinuxArm64 && npm run buildAppImage", + "buildAll": "npm run buildWindows && npm run buildMacIntel && npm run buildMacArm && npm run buildDebian && npm run buildRedhat && npm run buildAppImage", "buildAppImage": "npm run build && node ./scripts/buildAppImage.js", "updateFilters": "node ./ext/filterLists/updateEasylist.js", "updateHttpsList": "node ./ext/httpsUpgrade/updateHttpsList.js", diff --git a/scripts/buildDebian.js b/scripts/buildDebian.js index c11af4f9f..0c0f24b39 100644 --- a/scripts/buildDebian.js +++ b/scripts/buildDebian.js @@ -1,24 +1,10 @@ -const packageFile = require('./../package.json') -const version = packageFile.version -const platform = process.argv.find(arg => arg.match('platform')).split('=')[1] const builder = require('electron-builder') const Platform = builder.Platform const Arch = builder.Arch -function toArch (platform) { - switch (platform) { - case 'amd64': - return Arch.x64 - case 'armhf': - return Arch.armv7l - case 'arm64': - return Arch.arm64 - default: - return Arch.universal - } -} +const createPackage = require('./createPackage.js') -require('./createPackage.js')('linux', { arch: toArch(platform) }).then(function (path) { +async function afterPackageBuilt (path, arch) { var installerOptions = { artifactName: 'min-${version}-${arch}.deb', packageName: 'min', @@ -62,9 +48,9 @@ require('./createPackage.js')('linux', { arch: toArch(platform) }).then(function publish: null } - builder.build({ + await builder.build({ prepackaged: path, - targets: Platform.LINUX.createTarget(['deb'], toArch(platform)), + targets: Platform.LINUX.createTarget(['deb'], arch), config: options }) .then(() => console.log('Successfully created package.')) @@ -72,4 +58,10 @@ require('./createPackage.js')('linux', { arch: toArch(platform) }).then(function console.error(err, err.stack) process.exit(1) }) +} + +const arches = [Arch.x64, Arch.armv7l, Arch.arm64] + +arches.forEach(async (arch) => { + await createPackage('linux', { arch: arch }).then(path => afterPackageBuilt(path, arch)) })