Skip to content

Commit

Permalink
Merge pull request #175 from atom-ide-community/adjust-compression
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Sep 18, 2020
2 parents b72c904 + f2f8a1e commit 1ef6c44
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions script/lib/create-debian-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,32 @@ module.exports = function(packagedAppPath) {
);

console.log(`Generating .deb file from ${debianPackageDirPath}`);
spawnSync('fakeroot', ['dpkg-deb', '-b', debianPackageDirPath], {
stdio: 'inherit'
});

// don't compress by default to speed up build
let compressionLevel = 0;
let compressionType = 'none';
if (process.env.IS_RELEASE_BRANCH || process.env.IS_SIGNED_ZIP_BRANCH) {
compressionLevel = 6;
compressionType = 'xz';
}
// use sudo if available to speed up build
let sudoCommand = 'fakeroot';
if (process.env.CI === true || (process.getuid && process.getuid() === 0)) {
sudoCommand = 'sudo';
}
spawnSync(
sudoCommand,
[
'dpkg-deb',
`-Z${compressionType}`,
`-z${compressionLevel}`,
'-b',
debianPackageDirPath
],
{
stdio: 'inherit'
}
);

console.log(
`Copying generated package into "${outputDebianPackageFilePath}"`
Expand Down
2 changes: 1 addition & 1 deletion script/vsts/platforms/templates/preparation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ steps:
- script: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
sudo apt-get install -y build-essential ca-certificates xvfb fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0 libasound2 libicu-dev
sudo apt-get install -y build-essential ca-certificates xvfb fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0 libasound2 libicu-dev dpkg
# clang 9 is included in the image
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 10
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10
Expand Down

0 comments on commit 1ef6c44

Please sign in to comment.