mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-04 04:32:56 +08:00
Implement cache v2
This commit is contained in:
parent
146143a9b4
commit
9e63a77e7a
2
packages/cache/src/cache.ts
vendored
2
packages/cache/src/cache.ts
vendored
@ -229,7 +229,7 @@ export async function saveCache(
|
|||||||
// inputs:
|
// inputs:
|
||||||
// - getSignedUploadURL
|
// - getSignedUploadURL
|
||||||
// - archivePath
|
// - archivePath
|
||||||
core.debug(`Saving Cache v2: ${archivePath}`)
|
core.info(`Saving Cache v2: ${archivePath}`)
|
||||||
await UploadCache(signedUploadURL, archivePath)
|
await UploadCache(signedUploadURL, archivePath)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export async function UploadCache(
|
|||||||
uploadURL: GetCacheBlobUploadURLResponse,
|
uploadURL: GetCacheBlobUploadURLResponse,
|
||||||
archivePath: string,
|
archivePath: string,
|
||||||
): Promise<{}> {
|
): Promise<{}> {
|
||||||
core.info(`Uploading ${archivePath} to: ${uploadURL}`)
|
core.info(`Uploading ${archivePath} to: ${JSON.stringify(uploadURL)}`)
|
||||||
|
|
||||||
// Specify data transfer options
|
// Specify data transfer options
|
||||||
const uploadOptions: BlockBlobParallelUploadOptions = {
|
const uploadOptions: BlockBlobParallelUploadOptions = {
|
||||||
@ -19,8 +19,8 @@ export async function UploadCache(
|
|||||||
const blobClient: BlobClient = new BlobClient(uploadURL.urls[0].url)
|
const blobClient: BlobClient = new BlobClient(uploadURL.urls[0].url)
|
||||||
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
|
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
|
||||||
|
|
||||||
core.info(`BlobClient: ${blobClient}`)
|
core.info(`BlobClient: ${JSON.stringify(blobClient)}`)
|
||||||
core.info(`BlobClient: ${blockBlobClient}`)
|
core.info(`blockBlobClient: ${JSON.stringify(blockBlobClient)}`)
|
||||||
|
|
||||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user