mirror of https://github.com/actions/toolkit
Implement cache v2
parent
dccc3f7f1c
commit
6635d12ce0
|
@ -6,7 +6,7 @@ export async function UploadCache(
|
||||||
uploadURL: GetCacheBlobUploadURLResponse,
|
uploadURL: GetCacheBlobUploadURLResponse,
|
||||||
archivePath: string,
|
archivePath: string,
|
||||||
): Promise<{}> {
|
): Promise<{}> {
|
||||||
core.debug(`Uploading cache to: ${uploadURL}`)
|
core.info(`Uploading ${archivePath} to: ${uploadURL}`)
|
||||||
|
|
||||||
// Specify data transfer options
|
// Specify data transfer options
|
||||||
const uploadOptions: BlockBlobParallelUploadOptions = {
|
const uploadOptions: BlockBlobParallelUploadOptions = {
|
||||||
|
@ -15,10 +15,12 @@ export async function UploadCache(
|
||||||
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
maxSingleShotSize: 8 * 1024 * 1024, // 8 MiB initial transfer size
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create blob client from container client
|
|
||||||
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
// const blobClient: BlobClient = new BlobClient(uploadURL.urls[0])
|
||||||
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: ${blockBlobClient}`)
|
||||||
|
|
||||||
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
return blockBlobClient.uploadFile(archivePath, uploadOptions);
|
||||||
}
|
}
|
Loading…
Reference in New Issue