@actions/artifact 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,14 +42,34 @@ const errors_1 = require("../shared/errors");
|
|
|
42
42
|
function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
let uploadByteCount = 0;
|
|
45
|
+
let lastProgressTime = Date.now();
|
|
46
|
+
let timeoutId;
|
|
47
|
+
const chunkTimer = (timeout) => {
|
|
48
|
+
// clear the previous timeout
|
|
49
|
+
if (timeoutId) {
|
|
50
|
+
clearTimeout(timeoutId);
|
|
51
|
+
}
|
|
52
|
+
timeoutId = setTimeout(() => {
|
|
53
|
+
const now = Date.now();
|
|
54
|
+
// if there's been more than 30 seconds since the
|
|
55
|
+
// last progress event, then we'll consider the upload stalled
|
|
56
|
+
if (now - lastProgressTime > timeout) {
|
|
57
|
+
throw new Error('Upload progress stalled.');
|
|
58
|
+
}
|
|
59
|
+
}, timeout);
|
|
60
|
+
return timeoutId;
|
|
61
|
+
};
|
|
45
62
|
const maxConcurrency = (0, config_1.getConcurrency)();
|
|
46
63
|
const bufferSize = (0, config_1.getUploadChunkSize)();
|
|
47
64
|
const blobClient = new storage_blob_1.BlobClient(authenticatedUploadURL);
|
|
48
65
|
const blockBlobClient = blobClient.getBlockBlobClient();
|
|
66
|
+
const timeoutDuration = 300000; // 30 seconds
|
|
49
67
|
core.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`);
|
|
50
68
|
const uploadCallback = (progress) => {
|
|
51
69
|
core.info(`Uploaded bytes ${progress.loadedBytes}`);
|
|
52
70
|
uploadByteCount = progress.loadedBytes;
|
|
71
|
+
chunkTimer(timeoutDuration);
|
|
72
|
+
lastProgressTime = Date.now();
|
|
53
73
|
};
|
|
54
74
|
const options = {
|
|
55
75
|
blobHTTPHeaders: { blobContentType: 'zip' },
|
|
@@ -62,6 +82,8 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) {
|
|
|
62
82
|
zipUploadStream.pipe(hashStream).setEncoding('hex'); // This stream is used to compute a hash of the zip content that gets used. Integrity check
|
|
63
83
|
core.info('Beginning upload of artifact content to blob storage');
|
|
64
84
|
try {
|
|
85
|
+
// Start the chunk timer
|
|
86
|
+
timeoutId = chunkTimer(timeoutDuration);
|
|
65
87
|
yield blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options);
|
|
66
88
|
}
|
|
67
89
|
catch (error) {
|
|
@@ -70,6 +92,12 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) {
|
|
|
70
92
|
}
|
|
71
93
|
throw error;
|
|
72
94
|
}
|
|
95
|
+
finally {
|
|
96
|
+
// clear the timeout whether or not the upload completes
|
|
97
|
+
if (timeoutId) {
|
|
98
|
+
clearTimeout(timeoutId);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
73
101
|
core.info('Finished uploading artifact content to blob storage!');
|
|
74
102
|
hashStream.end();
|
|
75
103
|
sha256Hash = hashStream.read();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob-upload.js","sourceRoot":"","sources":["../../../src/internal/upload/blob-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA4E;AAG5E,6CAAmE;AACnE,oDAAqC;AACrC,+CAAgC;AAChC,+CAAgC;AAChC,6CAA6C;AAc7C,SAAsB,sBAAsB,CAC1C,sBAA8B,EAC9B,eAAgC;;QAEhC,IAAI,eAAe,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"blob-upload.js","sourceRoot":"","sources":["../../../src/internal/upload/blob-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA4E;AAG5E,6CAAmE;AACnE,oDAAqC;AACrC,+CAAgC;AA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eAAe,KAAK,CAAC,EAAE;YACzB,IAAI,CAAC,OAAO,CACV,wEAAwE,CACzE,CAAA;SACF;QACD,OAAO;YACL,UAAU,EAAE,eAAe;YAC3B,UAAU;SACX,CAAA;IACH,CAAC;CAAA;AA3FD,wDA2FC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actions/artifact",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"preview": true,
|
|
5
5
|
"description": "Actions artifact lib",
|
|
6
6
|
"keywords": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@octokit/plugin-retry": "^3.0.9",
|
|
50
50
|
"@octokit/request-error": "^5.0.0",
|
|
51
51
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
|
52
|
-
"archiver": "^
|
|
52
|
+
"archiver": "^7.0.1",
|
|
53
53
|
"crypto": "^1.0.1",
|
|
54
54
|
"jwt-decode": "^3.1.2",
|
|
55
55
|
"twirp-ts": "^2.5.0",
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
63
63
|
"typescript": "^5.2.2"
|
|
64
64
|
}
|
|
65
|
-
}
|
|
65
|
+
}
|