mirror of
https://github.com/electron/electron.git
synced 2026-01-10 16:08:06 -05:00
build: use xz compression
This commit is contained in:
@@ -66,11 +66,15 @@ def download(text, url, path):
|
||||
return path
|
||||
|
||||
|
||||
def make_zip(zip_file_path, files, dirs):
|
||||
def make_zip(zip_file_path, files, dirs, use_xz=False):
|
||||
safe_unlink(zip_file_path)
|
||||
if sys.platform == 'darwin':
|
||||
allfiles = files + dirs
|
||||
execute(['zip', '-r', '-y', '-9', zip_file_path] + allfiles)
|
||||
if use_xz:
|
||||
# Use xz compression for better compression ratio (vs deflate)
|
||||
execute(['zip', '-r', '-y', '-9', '-Z', 'xz', zip_file_path] + allfiles)
|
||||
else:
|
||||
execute(['zip', '-r', '-y', '-9', zip_file_path] + allfiles)
|
||||
else:
|
||||
with zipfile.ZipFile(zip_file_path, "w",
|
||||
zipfile.ZIP_DEFLATED,
|
||||
|
||||
@@ -36,7 +36,8 @@ def main():
|
||||
dsyms.remove(dsym)
|
||||
dsym_zip_file = os.path.join(args.build_dir, dsym_name)
|
||||
print('Making dsym zip: ' + dsym_zip_file)
|
||||
make_zip(dsym_zip_file, licenses, dsyms)
|
||||
# Use xz compression to reduce file size and stay under GitHub's 2GB limit
|
||||
make_zip(dsym_zip_file, licenses, dsyms, use_xz=True)
|
||||
dsym_snapshot_name = 'dsym-snapshot.zip'
|
||||
dsym_snapshot_zip_file = os.path.join(args.build_dir, dsym_snapshot_name)
|
||||
print('Making dsym snapshot zip: ' + dsym_snapshot_zip_file)
|
||||
|
||||
Reference in New Issue
Block a user