1
0
Fork 0

adding constant zlib compression level

pull/1700/head
Vallie Joseph 2024-03-28 19:16:10 +00:00
parent 59593338a6
commit 17c4cab8b2
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import * as stream from 'stream' import * as stream from 'stream'
import * as ZipStream from 'zip-stream' import * as ZipStream from 'zip-stream'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as zlib from 'zlib'
import {createReadStream} from 'fs' import {createReadStream} from 'fs'
import {UploadZipSpecification} from './upload-zip-specification' import {UploadZipSpecification} from './upload-zip-specification'
import {getUploadChunkSize} from '../shared/config' import {getUploadChunkSize} from '../shared/config'
@ -30,7 +31,10 @@ export async function createZipUploadStream(
`Creating Artifact archive with compressionLevel: ${compressionLevel}` `Creating Artifact archive with compressionLevel: ${compressionLevel}`
) )
const zlibOptions = { const zlibOptions = {
zlib: {level: DEFAULT_COMPRESSION_LEVEL, bufferSize: getUploadChunkSize()} zlib: {
level: zlib.constants.Z_DEFAULT_COMPRESSION,
bufferSize: getUploadChunkSize()
}
} }
const zip = new ZipStream.default(zlibOptions) const zip = new ZipStream.default(zlibOptions)
// register callbacks for various events during the zip lifecycle // register callbacks for various events during the zip lifecycle