diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 87bb7237..888077c0 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -52,14 +52,22 @@ export async function uploadZipToBlobStorage( zipUploadStream.pipe(hashStream).setEncoding('hex') // This stream is used to compute a hash of the zip content that gets used. Integrity check core.info('Beginning upload of artifact content to blob storage') - try { - await blockBlobClient.uploadStream( - uploadStream, - bufferSize, - maxConcurrency, - options - ) + await new Promise((resolve, reject) => { + uploadStream.on('readable', async () => { + try { + await blockBlobClient.uploadStream( + uploadStream, + bufferSize, + maxConcurrency, + options + ) + resolve('success') + } catch (error) { + reject(error) + } + }) + }) } catch (error) { if (NetworkError.isNetworkErrorCode(error?.code)) { throw new NetworkError(error?.code) @@ -67,6 +75,20 @@ export async function uploadZipToBlobStorage( throw error } + // try { + // await blockBlobClient.uploadStream( + // uploadStream, + // bufferSize, + // maxConcurrency, + // options + // ) + // } catch (error) { + // if (NetworkError.isNetworkErrorCode(error?.code)) { + // throw new NetworkError(error?.code) + // } + + // throw error + // } core.info('Finished uploading artifact content to blob storage!') diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 3c5b1ed2..e8a7117a 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -53,6 +53,7 @@ export async function createZipUploadStream( } ) } else { + // add directory to zip zip.entry(null, {name: file.destinationPath}, function (err, entry) { core.debug(`Entry is: ${entry}`) if (err) reject(err)