mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-03 17:32:55 +08:00
Implement cache v2
This commit is contained in:
parent
6635d12ce0
commit
146143a9b4
17
packages/cache/src/cache.ts
vendored
17
packages/cache/src/cache.ts
vendored
@ -224,6 +224,15 @@ export async function saveCache(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Cache v2 upload
|
||||||
|
// inputs:
|
||||||
|
// - getSignedUploadURL
|
||||||
|
// - archivePath
|
||||||
|
core.debug(`Saving Cache v2: ${archivePath}`)
|
||||||
|
await UploadCache(signedUploadURL, archivePath)
|
||||||
|
|
||||||
|
|
||||||
core.debug('Reserving Cache')
|
core.debug('Reserving Cache')
|
||||||
const reserveCacheResponse = await cacheHttpClient.reserveCache(
|
const reserveCacheResponse = await cacheHttpClient.reserveCache(
|
||||||
key,
|
key,
|
||||||
@ -252,14 +261,6 @@ export async function saveCache(
|
|||||||
|
|
||||||
core.debug(`Saving Cache (ID: ${cacheId})`)
|
core.debug(`Saving Cache (ID: ${cacheId})`)
|
||||||
await cacheHttpClient.saveCache(cacheId, archivePath, options)
|
await cacheHttpClient.saveCache(cacheId, archivePath, options)
|
||||||
|
|
||||||
// Cache v2 upload
|
|
||||||
// inputs:
|
|
||||||
// - getSignedUploadURL
|
|
||||||
// - archivePath
|
|
||||||
core.debug(`Saving Cache v2: ${archivePath}`)
|
|
||||||
await UploadCache(signedUploadURL, archivePath)
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const typedError = error as Error
|
const typedError = error as Error
|
||||||
if (typedError.name === ValidationError.name) {
|
if (typedError.name === ValidationError.name) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user