From a8b61326cfd5a37b83a6c774ba84d329fe8e5767 Mon Sep 17 00:00:00 2001 From: Dave Hadka Date: Fri, 8 May 2020 16:09:03 -0400 Subject: [PATCH] Disable zstd on Windows due to issue #301 --- dist/restore/index.js | 5 +++++ dist/save/index.js | 5 +++++ src/utils/actionUtils.ts | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/dist/restore/index.js b/dist/restore/index.js index f0b155d..d063a11 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -3231,6 +3231,7 @@ const core = __importStar(__webpack_require__(470)); const exec = __importStar(__webpack_require__(986)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); +const os = __importStar(__webpack_require__(87)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); @@ -3372,6 +3373,10 @@ function getVersion(app) { } function getCompressionMethod() { return __awaiter(this, void 0, void 0, function* () { + // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301 + if (os.platform() === "win32") { + return constants_1.CompressionMethod.Gzip; + } const versionOutput = yield getVersion("zstd"); return versionOutput.toLowerCase().includes("zstd command line interface") ? constants_1.CompressionMethod.Zstd diff --git a/dist/save/index.js b/dist/save/index.js index 6dd837c..7dba8da 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -3231,6 +3231,7 @@ const core = __importStar(__webpack_require__(470)); const exec = __importStar(__webpack_require__(986)); const glob = __importStar(__webpack_require__(281)); const io = __importStar(__webpack_require__(1)); +const os = __importStar(__webpack_require__(87)); const fs = __importStar(__webpack_require__(747)); const path = __importStar(__webpack_require__(622)); const util = __importStar(__webpack_require__(669)); @@ -3372,6 +3373,10 @@ function getVersion(app) { } function getCompressionMethod() { return __awaiter(this, void 0, void 0, function* () { + // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301 + if (os.platform() === "win32") { + return constants_1.CompressionMethod.Gzip; + } const versionOutput = yield getVersion("zstd"); return versionOutput.toLowerCase().includes("zstd command line interface") ? constants_1.CompressionMethod.Zstd diff --git a/src/utils/actionUtils.ts b/src/utils/actionUtils.ts index 12c1c36..dd5c8a4 100644 --- a/src/utils/actionUtils.ts +++ b/src/utils/actionUtils.ts @@ -3,6 +3,7 @@ import * as exec from "@actions/exec"; import * as glob from "@actions/glob"; import * as io from "@actions/io"; import * as fs from "fs"; +import * as os from "os"; import * as path from "path"; import * as util from "util"; import * as uuidV4 from "uuid/v4"; @@ -148,6 +149,11 @@ async function getVersion(app: string): Promise { } export async function getCompressionMethod(): Promise { + // Disabling zstd on Windows due to https://github.com/actions/cache/issues/301 + if (os.platform() === "win32") { + return CompressionMethod.Gzip; + } + const versionOutput = await getVersion("zstd"); return versionOutput.toLowerCase().includes("zstd command line interface") ? CompressionMethod.Zstd