Revert "Cache package release for compression change in windows" (#1289)

* Revert "Cache package release for compression change in windows (#1281)"

This reverts commit b228732644.

* Update release version to patch
This commit is contained in:
Sampark Sharma
2022-12-27 16:00:28 +05:30
committed by GitHub
parent b228732644
commit 86fe4abd8e
12 changed files with 149 additions and 686 deletions
+5 -25
View File
@@ -4,8 +4,6 @@ import * as utils from './internal/cacheUtils'
import * as cacheHttpClient from './internal/cacheHttpClient'
import {createTar, extractTar, listTar} from './internal/tar'
import {DownloadOptions, UploadOptions} from './options'
import {CompressionMethod} from './internal/constants'
import {ArtifactCacheEntry} from './internal/contracts'
export class ValidationError extends Error {
constructor(message: string) {
@@ -87,35 +85,17 @@ export async function restoreCache(
checkKey(key)
}
let cacheEntry: ArtifactCacheEntry | null
let compressionMethod = await utils.getCompressionMethod()
const compressionMethod = await utils.getCompressionMethod()
let archivePath = ''
try {
// path are needed to compute version
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
const cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
compressionMethod
})
if (!cacheEntry?.archiveLocation) {
// This is to support the old cache entry created by gzip on windows.
if (
process.platform === 'win32' &&
compressionMethod !== CompressionMethod.Gzip
) {
compressionMethod = CompressionMethod.Gzip
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
compressionMethod
})
if (!cacheEntry?.archiveLocation) {
return undefined
}
core.info(
"Couldn't find cache entry with zstd compression, falling back to gzip compression."
)
} else {
// Cache not found
return undefined
}
if (!cacheEntry?.archiveLocation) {
// Cache not found
return undefined
}
archivePath = path.join(