Deploy version 1.0.2

This commit is contained in:
Gitea Actions
2025-04-30 15:23:49 +00:00
parent 22b9427629
commit 3298677878

18
dist/index.js vendored
View File

@@ -26198,8 +26198,9 @@ function formatSize(bytes) {
}
return `${bytes.toFixed(2)} ${units[i2]}`;
}
function formatSpeed(bytes, seconds) {
if (seconds <= 0) return "\u221E";
function formatSpeed(bytes, ms) {
if (ms <= 0) return "\u221E";
const seconds = ms / 1e3;
const speedBytesPerSec = bytes / seconds;
const units = ["B/s", "KiB/s", "MiB/s", "GiB/s"];
let i2 = 0;
@@ -26277,7 +26278,6 @@ async function downloadCache(options, owner, repo, key, destinationPath) {
const endTime = Date.now();
const duration = endTime - startTime;
const size = fs2.statSync(destinationPath).size;
const speedMBs = size / 1024 / 1024 / duration;
console.log(`\u2705 Download completed`);
console.log(`\u{1F4E6} Size: ${formatSize(size)}`);
console.log(`\u23F1 Duration: ${formatDuration(duration)}`);
@@ -26329,7 +26329,7 @@ async function extractCompressedTar(archivePath, extractTo = "/") {
shell: "/bin/bash"
});
const endTime = Date.now();
const duration = (endTime - startTime) / 1e3;
const duration = endTime - startTime;
const size = fs3.statSync(archivePath).size;
const speedMBs = size / 1024 / 1024 / duration;
console.log(`\u2705 Extraction completed`);
@@ -26353,9 +26353,9 @@ async function saveCache(key, paths, cmprss_lvl = 3) {
archivePath
);
const endTime = Date.now();
const durationSeconds = ((endTime - startTime) / 1e3).toFixed(2);
const duration = endTime - startTime;
core.info(
`\u2705 Cache saved successfully (${formatSize(archiveSize)}, ${durationSeconds} s)
`\u2705 Cache saved successfully (${formatSize(archiveSize)}, ${formatDuration(duration)})
`
);
}
@@ -26382,9 +26382,11 @@ async function restoreCache(key) {
const archiveSize = fs5.statSync(zstPath).size;
await extractCompressedTar(zstPath);
const endTime = Date.now();
const durationSeconds = ((endTime - startTime) / 1e3).toFixed(2);
const durationSeconds = (endTime - startTime) / 1e3;
core2.info(
`\u2705 Cache restored successfully (${formatSize(archiveSize)}, ${durationSeconds} s)`
`
\u2705 Cache restored successfully (${formatSize(archiveSize)}, ${formatDuration(durationSeconds)})
`
);
return true;
}