From e71ddb9e5a78b34b509c6a6a19ada09f76b8f4df Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 28 Mar 2024 14:44:20 +0000 Subject: [PATCH] updating append and directory zips --- packages/artifact/src/internal/upload/zip.ts | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 8e15580a..0a10b18f 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -56,13 +56,27 @@ export async function createZipUploadStream( for (const file of uploadSpecification) { if (file.sourcePath !== null) { // Add a normal file to the zip - zip.append(createReadStream(file.sourcePath), { - name: file.destinationPath - }) + // zip.append(createReadStream(file.sourcePath), { + // name: file.destinationPath + // }) + zip.entry( + createReadStream(file.sourcePath), + {name: file.destinationPath}, + function (err, entry) { + core.debug(`Entry is: ${entry}`) + if (err) throw err + } + ) } else { + zip.entry(null, {name: file.destinationPath}, function (err, entry) { + core.debug(`Entry is: ${entry}`) + if (err) throw err + }) // Add a directory to the zip - zip.append('', {name: file.destinationPath}) + // zip.append('', {name: file.destinationPath}) } + + zip.finish() } const bufferSize = getUploadChunkSize()