mirror of https://github.com/actions/toolkit
adding promise to upload
parent
7441cc7b8b
commit
06482c6da1
|
@ -64,6 +64,7 @@ export async function createZipUploadStream(
|
|||
})
|
||||
|
||||
for (const file of uploadSpecification) {
|
||||
await new Promise((resolve, reject) => {
|
||||
if (file.sourcePath !== null) {
|
||||
// Add a normal file to the zip
|
||||
zip.entry(
|
||||
|
@ -71,26 +72,28 @@ export async function createZipUploadStream(
|
|||
{name: file.destinationPath},
|
||||
function (err, entry) {
|
||||
core.debug(`Entry is: ${entry}`)
|
||||
if (err) throw err
|
||||
if (err) reject(err)
|
||||
else resolve(entry)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
zip.entry(null, {name: file.destinationPath}, function (err, entry) {
|
||||
core.debug(`Entry is: ${entry}`)
|
||||
if (err) throw err
|
||||
if (err) reject(err)
|
||||
resolve(entry)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const bufferSize = getUploadChunkSize()
|
||||
const zipUploadStream = new ZipUploadStream(bufferSize)
|
||||
|
||||
// core.debug(
|
||||
// `Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
|
||||
// )
|
||||
// core.debug(
|
||||
// `Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
|
||||
// )
|
||||
core.debug(
|
||||
`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
|
||||
)
|
||||
core.debug(
|
||||
`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
|
||||
)
|
||||
|
||||
// zip.pipe(zipUploadStream)
|
||||
zip.finalize()
|
||||
|
|
Loading…
Reference in New Issue