diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 262f022..860f22d 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -94,7 +94,7 @@ ${o}:${decodeURIComponent(n[o])}`}return a}},Et=class extends Ql{constructor(e,i `):s=[e.accountName,a,r,n,t.startsOn?Fe(t.startsOn,!1):"",Fe(t.expiresOn,!1),t.ipRange?Vr(t.ipRange):"",t.protocol?t.protocol:"",i,""].join(` `);let o=e.computeHMACSHA256(s);return new dr(i,o,a.toString(),r,n,t.protocol,t.startsOn,t.expiresOn,t.ipRange,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,t.encryptionScope)}var KC=class t extends xl{constructor(e,i,a){let r;qn(i)?r=i:O.isNode&&i instanceof Et||i instanceof He||O.isTokenCredential(i)?r=Ge(i,a):r=Ge(new He,a),super(e,r),this.serviceContext=new Jm(this.storageClientContext)}static fromConnectionString(e,i){i=i||{};let a=NA(e);if(a.kind==="AccountConnString")if(O.isNode){let r=new Et(a.accountName,a.accountKey);i.proxyOptions||(i.proxyOptions=O.getDefaultProxySettings(a.proxyUri));let n=Ge(r,i);return new t(a.url,n)}else throw new Error("Account connection string is only supported in Node.js environment");else if(a.kind==="SASConnString"){let r=Ge(new He,i);return new t(a.url+"?"+a.accountSas,r)}else throw new Error("Connection string must be either an Account connection string or a SAS connection string")}getContainerClient(e){return new a1(ot(this.url,encodeURIComponent(e)),this.pipeline)}async createContainer(e,i={}){let{span:a,updatedOptions:r}=U("BlobServiceClient-createContainer",i);try{let n=this.getContainerClient(e),s=await n.create(r);return{containerClient:n,containerCreateResponse:s}}catch(n){throw a.setStatus({code:M.SpanStatusCode.ERROR,message:n.message}),n}finally{a.end()}}async deleteContainer(e,i={}){let{span:a,updatedOptions:r}=U("BlobServiceClient-deleteContainer",i);try{return await this.getContainerClient(e).delete(r)}catch(n){throw a.setStatus({code:M.SpanStatusCode.ERROR,message:n.message}),n}finally{a.end()}}async undeleteContainer(e,i,a={}){let{span:r,updatedOptions:n}=U("BlobServiceClient-undeleteContainer",a);try{let s=this.getContainerClient(a.destinationContainerName||e),A=await new _s(s.storageClientContext).restore(Object.assign({deletedContainerName:e,deletedContainerVersion:i},n));return{containerClient:s,containerUndeleteResponse:A}}catch(s){throw r.setStatus({code:M.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}async renameContainer(e,i,a={}){var r;let{span:n,updatedOptions:s}=U("BlobServiceClient-renameContainer",a);try{let o=this.getContainerClient(i),p=await new _s(o.storageClientContext).rename(e,Object.assign(Object.assign({},s),{sourceLeaseId:(r=a.sourceCondition)===null||r===void 0?void 0:r.leaseId}));return{containerClient:o,containerRenameResponse:p}}catch(o){throw n.setStatus({code:M.SpanStatusCode.ERROR,message:o.message}),o}finally{n.end()}}async getProperties(e={}){let{span:i,updatedOptions:a}=U("BlobServiceClient-getProperties",e);try{return await this.serviceContext.getProperties(Object.assign({abortSignal:e.abortSignal},X(a)))}catch(r){throw i.setStatus({code:M.SpanStatusCode.ERROR,message:r.message}),r}finally{i.end()}}async setProperties(e,i={}){let{span:a,updatedOptions:r}=U("BlobServiceClient-setProperties",i);try{return await this.serviceContext.setProperties(e,Object.assign({abortSignal:i.abortSignal},X(r)))}catch(n){throw a.setStatus({code:M.SpanStatusCode.ERROR,message:n.message}),n}finally{a.end()}}async getStatistics(e={}){let{span:i,updatedOptions:a}=U("BlobServiceClient-getStatistics",e);try{return await this.serviceContext.getStatistics(Object.assign({abortSignal:e.abortSignal},X(a)))}catch(r){throw i.setStatus({code:M.SpanStatusCode.ERROR,message:r.message}),r}finally{i.end()}}async getAccountInfo(e={}){let{span:i,updatedOptions:a}=U("BlobServiceClient-getAccountInfo",e);try{return await this.serviceContext.getAccountInfo(Object.assign({abortSignal:e.abortSignal},X(a)))}catch(r){throw i.setStatus({code:M.SpanStatusCode.ERROR,message:r.message}),r}finally{i.end()}}async listContainersSegment(e,i={}){let{span:a,updatedOptions:r}=U("BlobServiceClient-listContainersSegment",i);try{return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({abortSignal:i.abortSignal,marker:e},i),{include:typeof i.include=="string"?[i.include]:i.include}),X(r)))}catch(n){throw a.setStatus({code:M.SpanStatusCode.ERROR,message:n.message}),n}finally{a.end()}}async findBlobsByTagsSegment(e,i,a={}){let{span:r,updatedOptions:n}=U("BlobServiceClient-findBlobsByTagsSegment",a);try{let s=await this.serviceContext.filterBlobs(Object.assign({abortSignal:a.abortSignal,where:e,marker:i,maxPageSize:a.maxPageSize},X(n)));return Object.assign(Object.assign({},s),{_response:s._response,blobs:s.blobs.map(A=>{var p;let l="";return((p=A.tags)===null||p===void 0?void 0:p.blobTagSet.length)===1&&(l=A.tags.blobTagSet[0].value),Object.assign(Object.assign({},A),{tags:fl(A.tags),tagValue:l})})})}catch(s){throw r.setStatus({code:M.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}findBlobsByTagsSegments(e,i,a={}){return q.__asyncGenerator(this,arguments,function*(){let n;if(i||i===void 0)do n=yield q.__await(this.findBlobsByTagsSegment(e,i,a)),n.blobs=n.blobs||[],i=n.continuationToken,yield yield q.__await(n);while(i)})}findBlobsByTagsItems(e,i={}){return q.__asyncGenerator(this,arguments,function*(){var r,n;let s;try{for(var o=q.__asyncValues(this.findBlobsByTagsSegments(e,s,i)),A;A=yield q.__await(o.next()),!A.done;){let p=A.value;yield q.__await(yield*q.__asyncDelegator(q.__asyncValues(p.blobs)))}}catch(p){r={error:p}}finally{try{A&&!A.done&&(n=o.return)&&(yield q.__await(n.call(o)))}finally{if(r)throw r.error}}})}findBlobsByTags(e,i={}){let a=Object.assign({},i),r=this.findBlobsByTagsItems(e,a);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(n={})=>this.findBlobsByTagsSegments(e,n.continuationToken,Object.assign({maxPageSize:n.maxPageSize},a))}}listSegments(e,i={}){return q.__asyncGenerator(this,arguments,function*(){let r;if(e||e===void 0)do r=yield q.__await(this.listContainersSegment(e,i)),r.containerItems=r.containerItems||[],e=r.continuationToken,yield yield q.__await(yield q.__await(r));while(e)})}listItems(e={}){return q.__asyncGenerator(this,arguments,function*(){var a,r;let n;try{for(var s=q.__asyncValues(this.listSegments(n,e)),o;o=yield q.__await(s.next()),!o.done;){let A=o.value;yield q.__await(yield*q.__asyncDelegator(q.__asyncValues(A.containerItems)))}}catch(A){a={error:A}}finally{try{o&&!o.done&&(r=s.return)&&(yield q.__await(r.call(s)))}finally{if(a)throw a.error}}})}listContainers(e={}){e.prefix===""&&(e.prefix=void 0);let i=[];e.includeDeleted&&i.push("deleted"),e.includeMetadata&&i.push("metadata"),e.includeSystem&&i.push("system");let a=Object.assign(Object.assign({},e),i.length>0?{include:i}:{}),r=this.listItems(a);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(n={})=>this.listSegments(n.continuationToken,Object.assign({maxPageSize:n.maxPageSize},a))}}async getUserDelegationKey(e,i,a={}){let{span:r,updatedOptions:n}=U("BlobServiceClient-getUserDelegationKey",a);try{let s=await this.serviceContext.getUserDelegationKey({startsOn:Fe(e,!1),expiresOn:Fe(i,!1)},Object.assign({abortSignal:a.abortSignal},X(n))),o={signedObjectId:s.signedObjectId,signedTenantId:s.signedTenantId,signedStartsOn:new Date(s.signedStartsOn),signedExpiresOn:new Date(s.signedExpiresOn),signedService:s.signedService,signedVersion:s.signedVersion,value:s.value};return Object.assign({_response:s._response,requestId:s.requestId,clientRequestId:s.clientRequestId,version:s.version,date:s.date,errorCode:s.errorCode},o)}catch(s){throw r.setStatus({code:M.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}getBlobBatchClient(){return new Dl(this.url,this.pipeline)}generateAccountSasUrl(e,i=Tl.parse("r"),a="sco",r={}){if(!(this.credential instanceof Et))throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");if(e===void 0){let s=new Date;e=new Date(s.getTime()+3600*1e3)}let n=BT(Object.assign({permissions:i,expiresOn:e,resourceTypes:a,services:kl.parse("b").toString()},r),this.credential).toString();return E4(this.url,n)}};ee.KnownEncryptionAlgorithmType=void 0;(function(t){t.AES256="AES256"})(ee.KnownEncryptionAlgorithmType||(ee.KnownEncryptionAlgorithmType={}));Object.defineProperty(ee,"BaseRequestPolicy",{enumerable:!0,get:function(){return O.BaseRequestPolicy}});Object.defineProperty(ee,"HttpHeaders",{enumerable:!0,get:function(){return O.HttpHeaders}});Object.defineProperty(ee,"RequestPolicyOptions",{enumerable:!0,get:function(){return O.RequestPolicyOptions}});Object.defineProperty(ee,"RestError",{enumerable:!0,get:function(){return O.RestError}});Object.defineProperty(ee,"WebResource",{enumerable:!0,get:function(){return O.WebResource}});Object.defineProperty(ee,"deserializationPolicy",{enumerable:!0,get:function(){return O.deserializationPolicy}});ee.AccountSASPermissions=Tl;ee.AccountSASResourceTypes=r1;ee.AccountSASServices=kl;ee.AnonymousCredential=He;ee.AnonymousCredentialPolicy=e1;ee.AppendBlobClient=Nl;ee.BlobBatch=cA;ee.BlobBatchClient=Dl;ee.BlobClient=Oa;ee.BlobLeaseClient=wl;ee.BlobSASPermissions=Hr;ee.BlobServiceClient=KC;ee.BlockBlobClient=Rl;ee.ContainerClient=a1;ee.ContainerSASPermissions=zr;ee.Credential=Ql;ee.CredentialPolicy=Il;ee.PageBlobClient=Sl;ee.Pipeline=bl;ee.SASQueryParameters=dr;ee.StorageBrowserPolicy=Xm;ee.StorageBrowserPolicyFactory=Km;ee.StorageOAuthScopes=g4;ee.StorageRetryPolicy=Zm;ee.StorageRetryPolicyFactory=$m;ee.StorageSharedKeyCredential=Et;ee.StorageSharedKeyCredentialPolicy=t1;ee.generateAccountSASQueryParameters=BT;ee.generateBlobSASQueryParameters=y4;ee.isPipelineLike=qn;ee.logger=Fa;ee.newPipeline=Ge});var I4=v(Ct=>{"use strict";var dre=Ct&&Ct.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),ure=Ct&&Ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mre=Ct&&Ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&dre(e,t,i);return ure(e,t),e},u1=Ct&&Ct.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.retryHttpClientResponse=Ct.retryTypedResponse=Ct.retry=Ct.isRetryableStatusCode=Ct.isServerErrorStatusCode=Ct.isSuccessStatusCode=void 0;var QT=mre(Ra()),d1=Qp(),DA=Fp();function hre(t){return t?t>=200&&t<300:!1}Ct.isSuccessStatusCode=hre;function bT(t){return t?t>=500:!0}Ct.isServerErrorStatusCode=bT;function vT(t){return t?[d1.HttpCodes.BadGateway,d1.HttpCodes.ServiceUnavailable,d1.HttpCodes.GatewayTimeout].includes(t):!1}Ct.isRetryableStatusCode=vT;function gre(t){return u1(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function B4(t,e,i,a=DA.DefaultRetryAttempts,r=DA.DefaultRetryDelay,n=void 0){return u1(this,void 0,void 0,function*(){let s="",o=1;for(;o<=a;){let A,p,l=!1;try{A=yield e()}catch(c){n&&(A=n(c)),l=!0,s=c.message}if(A&&(p=i(A),!bT(p)))return A;if(p&&(l=vT(p),s=`Cache service responded with ${p}`),QT.debug(`${t} - Attempt ${o} of ${a} failed with error: ${s}`),!l){QT.debug(`${t} - Error is not retryable`);break}yield gre(r),o++}throw Error(`${t} failed: ${s}`)})}Ct.retry=B4;function fre(t,e,i=DA.DefaultRetryAttempts,a=DA.DefaultRetryDelay){return u1(this,void 0,void 0,function*(){return yield B4(t,e,r=>r.statusCode,i,a,r=>{if(r instanceof d1.HttpClientError)return{statusCode:r.statusCode,result:null,headers:{},error:r}})})}Ct.retryTypedResponse=fre;function Ere(t,e,i=DA.DefaultRetryAttempts,a=DA.DefaultRetryDelay){return u1(this,void 0,void 0,function*(){return yield B4(t,e,r=>r.message.statusCode,i,a)})}Ct.retryHttpClientResponse=Ere});var ST=v(Wt=>{"use strict";var Cre=Wt&&Wt.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),yre=Wt&&Wt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TA=Wt&&Wt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&Cre(e,t,i);return yre(e,t),e},ya=Wt&&Wt.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.downloadCacheStorageSDK=Wt.downloadCacheHttpClientConcurrent=Wt.downloadCacheHttpClient=Wt.DownloadProgress=void 0;var Ml=TA(Ra()),wT=Qp(),Bre=IT(),Ire=TA(require("buffer")),Ol=TA(require("fs")),Qre=TA(require("stream")),bre=TA(require("util")),vre=TA(Mp()),xT=Fp(),Q4=I4(),xre=Go();function wre(t,e){return ya(this,void 0,void 0,function*(){yield bre.promisify(Qre.pipeline)(t.message,e)})}var Pl=class{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset=this.segmentOffset+this.segmentSize,this.segmentIndex=this.segmentIndex+1,this.segmentSize=e,this.receivedBytes=0,Ml.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.receivedBytes=e}getTransferredBytes(){return this.segmentOffset+this.receivedBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,i=(100*(e/this.contentLength)).toFixed(1),a=Date.now()-this.startTime,r=(e/(1024*1024)/(a/1e3)).toFixed(1);Ml.info(`Received ${e} of ${this.contentLength} (${i}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let i=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(i,e))};this.timeoutHandle=setTimeout(i,e)}stopDisplayTimer(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0),this.display()}};Wt.DownloadProgress=Pl;function NT(t,e){return ya(this,void 0,void 0,function*(){let i=Ol.createWriteStream(e),a=new wT.HttpClient("actions/cache"),r=yield(0,Q4.retryHttpClientResponse)("downloadCache",()=>ya(this,void 0,void 0,function*(){return a.get(t)}));r.message.socket.setTimeout(xT.SocketTimeout,()=>{r.message.destroy(),Ml.debug(`Aborting download, socket timed out after ${xT.SocketTimeout} ms`)}),yield wre(r,i);let n=r.message.headers["content-length"];if(n){let s=parseInt(n),o=vre.getArchiveFileSizeInBytes(e);if(o!==s)throw new Error(`Incomplete download. Expected file size: ${s}, actual file size: ${o}`)}else Ml.debug("Unable to validate download, no Content-Length header")})}Wt.downloadCacheHttpClient=NT;function Nre(t,e,i){var a;return ya(this,void 0,void 0,function*(){let r=yield Ol.promises.open(e,"w"),n=new wT.HttpClient("actions/cache",void 0,{socketTimeout:i.timeoutInMs,keepAlive:!0});try{let o=(yield(0,Q4.retryHttpClientResponse)("downloadCacheMetadata",()=>ya(this,void 0,void 0,function*(){return yield n.request("HEAD",t,null,{})}))).message.headers["content-length"];if(o==null)throw new Error("Content-Length not found on blob response");let A=parseInt(o);if(Number.isNaN(A))throw new Error(`Could not interpret Content-Length: ${A}`);let p=[],l=4*1024*1024;for(let N=0;Nya(this,void 0,void 0,function*(){return yield Rre(n,t,N,C)})})}p.reverse();let c=0,d=0,u=new Pl(A);u.startDisplayTimer();let m=u.onProgress(),f=[],B,y=()=>ya(this,void 0,void 0,function*(){let N=yield Promise.race(Object.values(f));yield r.write(N.buffer,0,N.count,N.offset),c--,delete f[N.offset],d+=N.count,m({loadedBytes:d})});for(;B=p.pop();)f[B.offset]=B.promiseGetter(),c++,c>=((a=i.downloadConcurrency)!==null&&a!==void 0?a:10)&&(yield y());for(;c>0;)yield y()}finally{n.dispose(),yield r.close()}})}Wt.downloadCacheHttpClientConcurrent=Nre;function Rre(t,e,i,a){return ya(this,void 0,void 0,function*(){let n=0;for(;;)try{let o=yield RT(3e4,Sre(t,e,i,a));if(typeof o=="string")throw new Error("downloadSegmentRetry failed due to timeout");return o}catch(s){if(n>=5)throw s;n++}})}function Sre(t,e,i,a){return ya(this,void 0,void 0,function*(){let r=yield(0,Q4.retryHttpClientResponse)("downloadCachePart",()=>ya(this,void 0,void 0,function*(){return yield t.get(e,{Range:`bytes=${i}-${i+a-1}`})}));if(!r.readBodyBuffer)throw new Error("Expected HttpClientResponse to implement readBodyBuffer");return{offset:i,count:a,buffer:yield r.readBodyBuffer()}})}function Dre(t,e,i){var a;return ya(this,void 0,void 0,function*(){let r=new Bre.BlockBlobClient(t,void 0,{retryOptions:{tryTimeoutInMs:i.timeoutInMs}}),s=(a=(yield r.getProperties()).contentLength)!==null&&a!==void 0?a:-1;if(s<0)Ml.debug("Unable to determine content length, downloading file with http-client..."),yield NT(t,e);else{let o=Math.min(134217728,Ire.constants.MAX_LENGTH),A=new Pl(s),p=Ol.openSync(e,"w");try{A.startDisplayTimer();let l=new xre.AbortController,c=l.signal;for(;!A.isDone();){let d=A.segmentOffset+A.segmentSize,u=Math.min(o,s-d);A.nextSegment(u);let m=yield RT(i.segmentTimeoutInMs||36e5,r.downloadToBuffer(d,u,{abortSignal:c,concurrency:i.downloadConcurrency,onProgress:A.onProgress()}));if(m==="timeout")throw l.abort(),new Error("Aborting cache download as the download time exceeded the timeout.");Buffer.isBuffer(m)&&Ol.writeFileSync(p,m)}}finally{A.stopDisplayTimer(),Ol.closeSync(p)}}})}Wt.downloadCacheStorageSDK=Dre;var RT=(t,e)=>ya(void 0,void 0,void 0,function*(){let i,a=new Promise(r=>{i=setTimeout(()=>r("timeout"),t)});return Promise.race([e,a]).then(r=>(clearTimeout(i),r))})});var DT=v(Ba=>{"use strict";var Tre=Ba&&Ba.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),kre=Ba&&Ba.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_re=Ba&&Ba.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&Tre(e,t,i);return kre(e,t),e};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.getDownloadOptions=Ba.getUploadOptions=void 0;var Hn=_re(Ra());function Lre(t){let e={uploadConcurrency:4,uploadChunkSize:33554432};return t&&(typeof t.uploadConcurrency=="number"&&(e.uploadConcurrency=t.uploadConcurrency),typeof t.uploadChunkSize=="number"&&(e.uploadChunkSize=t.uploadChunkSize)),Hn.debug(`Upload concurrency: ${e.uploadConcurrency}`),Hn.debug(`Upload chunk size: ${e.uploadChunkSize}`),e}Ba.getUploadOptions=Lre;function Fre(t){let e={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};t&&(typeof t.useAzureSdk=="boolean"&&(e.useAzureSdk=t.useAzureSdk),typeof t.concurrentBlobDownloads=="boolean"&&(e.concurrentBlobDownloads=t.concurrentBlobDownloads),typeof t.downloadConcurrency=="number"&&(e.downloadConcurrency=t.downloadConcurrency),typeof t.timeoutInMs=="number"&&(e.timeoutInMs=t.timeoutInMs),typeof t.segmentTimeoutInMs=="number"&&(e.segmentTimeoutInMs=t.segmentTimeoutInMs),typeof t.lookupOnly=="boolean"&&(e.lookupOnly=t.lookupOnly));let i=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return i&&!isNaN(Number(i))&&isFinite(Number(i))&&(e.segmentTimeoutInMs=Number(i)*60*1e3),Hn.debug(`Use Azure SDK: ${e.useAzureSdk}`),Hn.debug(`Download concurrency: ${e.downloadConcurrency}`),Hn.debug(`Request timeout (ms): ${e.timeoutInMs}`),Hn.debug(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),Hn.debug(`Segment download timeout (ms): ${e.segmentTimeoutInMs}`),Hn.debug(`Lookup only: ${e.lookupOnly}`),e}Ba.getDownloadOptions=Fre});var _T=v(Rt=>{"use strict";var Ore=Rt&&Rt.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),Mre=Rt&&Rt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g1=Rt&&Rt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&Ore(e,t,i);return Mre(e,t),e},Fi=Rt&&Rt.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.saveCache=Rt.reserveCache=Rt.downloadCache=Rt.getCacheEntry=Rt.getCacheVersion=void 0;var ta=g1(Ra()),Pre=Qp(),Ure=Ff(),qre=g1(require("crypto")),b4=g1(require("fs")),Hre=require("url"),h1=g1(Mp()),m1=ST(),kT=DT(),zn=I4(),zre="1.0";function Ul(t){let e=process.env.ACTIONS_CACHE_URL||"";if(!e)throw new Error("Cache Service Url not found, unable to restore cache.");let i=`${e}_apis/artifactcache/${t}`;return ta.debug(`Resource Url: ${i}`),i}function Vre(t,e){return`${t};api-version=${e}`}function Gre(){return{headers:{Accept:Vre("application/json","6.0-preview.1")}}}function v4(){let t=process.env.ACTIONS_RUNTIME_TOKEN||"",e=new Ure.BearerCredentialHandler(t);return new Pre.HttpClient("actions/cache",[e],Gre())}function x4(t,e,i=!1){let a=t;return e&&a.push(e),process.platform==="win32"&&!i&&a.push("windows-only"),a.push(zre),qre.createHash("sha256").update(a.join("|")).digest("hex")}Rt.getCacheVersion=x4;function Yre(t,e,i){return Fi(this,void 0,void 0,function*(){let a=v4(),r=x4(e,i?.compressionMethod,i?.enableCrossOsArchive),n=`cache?keys=${encodeURIComponent(t.join(","))}&version=${r}`,s=yield(0,zn.retryTypedResponse)("getCacheEntry",()=>Fi(this,void 0,void 0,function*(){return a.getJson(Ul(n))}));if(s.statusCode===204)return ta.isDebug()&&(yield jre(t[0],a,r)),null;if(!(0,zn.isSuccessStatusCode)(s.statusCode))throw new Error(`Cache service responded with ${s.statusCode}`);let o=s.result,A=o?.archiveLocation;if(!A)throw new Error("Cache not found.");return ta.setSecret(A),ta.debug("Cache Result:"),ta.debug(JSON.stringify(o)),o})}Rt.getCacheEntry=Yre;function jre(t,e,i){return Fi(this,void 0,void 0,function*(){let a=`caches?key=${encodeURIComponent(t)}`,r=yield(0,zn.retryTypedResponse)("listCache",()=>Fi(this,void 0,void 0,function*(){return e.getJson(Ul(a))}));if(r.statusCode===200){let n=r.result,s=n?.totalCount;if(s&&s>0){ta.debug(`No matching cache found for cache key '${t}', version '${i} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`);for(let o of n?.artifactCaches||[])ta.debug(`Cache Key: ${o?.cacheKey}, Cache Version: ${o?.cacheVersion}, Cache Scope: ${o?.scope}, Cache Created: ${o?.creationTime}`)}}})}function Jre(t,e,i){return Fi(this,void 0,void 0,function*(){let a=new Hre.URL(t),r=(0,kT.getDownloadOptions)(i);a.hostname.endsWith(".blob.core.windows.net")?r.useAzureSdk?yield(0,m1.downloadCacheStorageSDK)(t,e,r):r.concurrentBlobDownloads?yield(0,m1.downloadCacheHttpClientConcurrent)(t,e,r):yield(0,m1.downloadCacheHttpClient)(t,e):yield(0,m1.downloadCacheHttpClient)(t,e)})}Rt.downloadCache=Jre;function Wre(t,e,i){return Fi(this,void 0,void 0,function*(){let a=v4(),r=x4(e,i?.compressionMethod,i?.enableCrossOsArchive),n={key:t,version:r,cacheSize:i?.cacheSize};return yield(0,zn.retryTypedResponse)("reserveCache",()=>Fi(this,void 0,void 0,function*(){return a.postJson(Ul("caches"),n)}))})}Rt.reserveCache=Wre;function TT(t,e){return`bytes ${t}-${e}/*`}function Xre(t,e,i,a,r){return Fi(this,void 0,void 0,function*(){ta.debug(`Uploading chunk of size ${r-a+1} bytes at offset ${a} with content range: ${TT(a,r)}`);let n={"Content-Type":"application/octet-stream","Content-Range":TT(a,r)},s=yield(0,zn.retryHttpClientResponse)(`uploadChunk (start: ${a}, end: ${r})`,()=>Fi(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,i(),n)}));if(!(0,zn.isSuccessStatusCode)(s.message.statusCode))throw new Error(`Cache service responded with ${s.message.statusCode} during upload chunk.`)})}function Kre(t,e,i,a){return Fi(this,void 0,void 0,function*(){let r=h1.getArchiveFileSizeInBytes(i),n=Ul(`caches/${e.toString()}`),s=b4.openSync(i,"r"),o=(0,kT.getUploadOptions)(a),A=h1.assertDefined("uploadConcurrency",o.uploadConcurrency),p=h1.assertDefined("uploadChunkSize",o.uploadChunkSize),l=[...new Array(A).keys()];ta.debug("Awaiting all uploads");let c=0;try{yield Promise.all(l.map(()=>Fi(this,void 0,void 0,function*(){for(;cb4.createReadStream(i,{fd:s,start:u,end:m,autoClose:!1}).on("error",f=>{throw new Error(`Cache upload failed because file read failed with ${f.message}`)}),u,m)}})))}finally{b4.closeSync(s)}})}function Zre(t,e,i){return Fi(this,void 0,void 0,function*(){let a={size:i};return yield(0,zn.retryTypedResponse)("commitCache",()=>Fi(this,void 0,void 0,function*(){return t.postJson(Ul(`caches/${e.toString()}`),a)}))})}function $re(t,e,i){return Fi(this,void 0,void 0,function*(){let a=v4();ta.debug("Upload cache"),yield Kre(a,t,e,i),ta.debug("Commiting cache");let r=h1.getArchiveFileSizeInBytes(e);ta.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);let n=yield Zre(a,t,r);if(!(0,zn.isSuccessStatusCode)(n.statusCode))throw new Error(`Cache service responded with ${n.statusCode} during commit cache.`);ta.info("Cache saved successfully")})}Rt.saveCache=$re});var OT=v(di=>{"use strict";var ene=di&&di.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),tne=di&&di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w4=di&&di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&ene(e,t,i);return tne(e,t),e},jr=di&&di.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(di,"__esModule",{value:!0});di.createTar=di.extractTar=di.listTar=void 0;var ine=Wf(),f1=w4(Fd()),LT=require("fs"),Pa=w4(require("path")),N4=w4(Mp()),tt=Fp(),Vn=process.platform==="win32";function ane(){return jr(this,void 0,void 0,function*(){switch(process.platform){case"win32":{let t=yield N4.getGnuTarPathOnWindows(),e=tt.SystemTarPathOnWindows;if(t)return{path:t,type:tt.ArchiveToolType.GNU};if((0,LT.existsSync)(e))return{path:e,type:tt.ArchiveToolType.BSD};break}case"darwin":{let t=yield f1.which("gtar",!1);return t?{path:t,type:tt.ArchiveToolType.GNU}:{path:yield f1.which("tar",!0),type:tt.ArchiveToolType.BSD}}default:break}return{path:yield f1.which("tar",!0),type:tt.ArchiveToolType.GNU}})}function rne(t,e,i,a=""){return jr(this,void 0,void 0,function*(){let r=[`"${t.path}"`],n=N4.getCacheFileName(e),s="cache.tar",o=FT(),A=t.type===tt.ArchiveToolType.BSD&&e!==tt.CompressionMethod.Gzip&&Vn;switch(i){case"create":r.push("--posix","-cf",A?s:n.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),"--exclude",A?s:n.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),"--files-from",tt.ManifestFilename);break;case"extract":r.push("-xf",A?s:a.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"));break;case"list":r.push("-tf",A?s:a.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),"-P");break}if(t.type===tt.ArchiveToolType.GNU)switch(process.platform){case"win32":r.push("--force-local");break;case"darwin":r.push("--delay-directory-restore");break}return r})}function R4(t,e,i=""){return jr(this,void 0,void 0,function*(){let a,r=yield ane(),n=yield rne(r,t,e,i),s=e!=="create"?yield nne(r,t,i):yield sne(r,t),o=r.type===tt.ArchiveToolType.BSD&&t!==tt.CompressionMethod.Gzip&&Vn;return o&&e!=="create"?a=[[...s].join(" "),[...n].join(" ")]:a=[[...n].join(" "),[...s].join(" ")],o?a:[a.join(" ")]})}function FT(){var t;return(t=process.env.GITHUB_WORKSPACE)!==null&&t!==void 0?t:process.cwd()}function nne(t,e,i){return jr(this,void 0,void 0,function*(){let a=t.type===tt.ArchiveToolType.BSD&&e!==tt.CompressionMethod.Gzip&&Vn;switch(e){case tt.CompressionMethod.Zstd:return a?["zstd -d --long=30 --force -o",tt.TarFilename,i.replace(new RegExp(`\\${Pa.sep}`,"g"),"/")]:["--use-compress-program",Vn?'"zstd -d --long=30"':"unzstd --long=30"];case tt.CompressionMethod.ZstdWithoutLong:return a?["zstd -d --force -o",tt.TarFilename,i.replace(new RegExp(`\\${Pa.sep}`,"g"),"/")]:["--use-compress-program",Vn?'"zstd -d"':"unzstd"];default:return["-z"]}})}function sne(t,e){return jr(this,void 0,void 0,function*(){let i=N4.getCacheFileName(e),a=t.type===tt.ArchiveToolType.BSD&&e!==tt.CompressionMethod.Gzip&&Vn;switch(e){case tt.CompressionMethod.Zstd:return a?["zstd -T0 --long=30 --force -o",i.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),tt.TarFilename]:["--use-compress-program",Vn?'"zstd -T0 --long=30"':"zstdmt --long=30"];case tt.CompressionMethod.ZstdWithoutLong:return a?["zstd -T0 --force -o",i.replace(new RegExp(`\\${Pa.sep}`,"g"),"/"),tt.TarFilename]:["--use-compress-program",Vn?'"zstd -T0"':"zstdmt"];default:return["-z"]}})}function S4(t,e){return jr(this,void 0,void 0,function*(){for(let i of t)try{yield(0,ine.exec)(i,void 0,{cwd:e,env:Object.assign(Object.assign({},process.env),{MSYS:"winsymlinks:nativestrict"})})}catch(a){throw new Error(`${i.split(" ")[0]} failed with error: ${a?.message}`)}})}function one(t,e){return jr(this,void 0,void 0,function*(){let i=yield R4(e,"list",t);yield S4(i)})}di.listTar=one;function Ane(t,e){return jr(this,void 0,void 0,function*(){let i=FT();yield f1.mkdirP(i);let a=yield R4(e,"extract",t);yield S4(a)})}di.extractTar=Ane;function pne(t,e,i){return jr(this,void 0,void 0,function*(){(0,LT.writeFileSync)(Pa.join(t,tt.ManifestFilename),e.join(` -`));let a=yield R4(i,"create");yield S4(a,t)})}di.createTar=pne});var HT=v(St=>{"use strict";var lne=St&&St.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),cne=St&&St.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y1=St&&St.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&lne(e,t,i);return cne(e,t),e},MT=St&&St.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(St,"__esModule",{value:!0});St.saveCache=St.restoreCache=St.isFeatureAvailable=St.ReserveCacheError=St.ValidationError=void 0;var Mt=y1(Ra()),PT=y1(require("path")),Ia=y1(Mp()),E1=y1(_T()),C1=OT(),Jr=class t extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}};St.ValidationError=Jr;var ql=class t extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}};St.ReserveCacheError=ql;function UT(t){if(!t||t.length===0)throw new Jr("Path Validation Error: At least one directory or file path is required")}function qT(t){if(t.length>512)throw new Jr(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new Jr(`Key Validation Error: ${t} cannot contain commas.`)}function dne(){return!!process.env.ACTIONS_CACHE_URL}St.isFeatureAvailable=dne;function une(t,e,i,a,r=!1){return MT(this,void 0,void 0,function*(){UT(t),i=i||[];let n=[e,...i];if(Mt.debug("Resolved Keys:"),Mt.debug(JSON.stringify(n)),n.length>10)throw new Jr("Key Validation Error: Keys are limited to a maximum of 10.");for(let A of n)qT(A);let s=yield Ia.getCompressionMethod(),o="";try{let A=yield E1.getCacheEntry(n,t,{compressionMethod:s,enableCrossOsArchive:r});if(!A?.archiveLocation)return;if(a?.lookupOnly)return Mt.info("Lookup only - skipping download"),A.cacheKey;o=PT.join(yield Ia.createTempDirectory(),Ia.getCacheFileName(s)),Mt.debug(`Archive Path: ${o}`),yield E1.downloadCache(A.archiveLocation,o,a),Mt.isDebug()&&(yield(0,C1.listTar)(o,s));let p=Ia.getArchiveFileSizeInBytes(o);return Mt.info(`Cache Size: ~${Math.round(p/(1024*1024))} MB (${p} B)`),yield(0,C1.extractTar)(o,s),Mt.info("Cache restored successfully"),A.cacheKey}catch(A){if(A.name===Jr.name)throw A;Mt.warning(`Failed to restore: ${A.message}`)}finally{try{yield Ia.unlinkFile(o)}catch(A){Mt.debug(`Failed to delete archive: ${A}`)}}})}St.restoreCache=une;function mne(t,e,i,a=!1){var r,n,s,o,A;return MT(this,void 0,void 0,function*(){UT(t),qT(e);let p=yield Ia.getCompressionMethod(),l=-1,c=yield Ia.resolvePaths(t);if(Mt.debug("Cache Paths:"),Mt.debug(`${JSON.stringify(c)}`),c.length===0)throw new Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let d=yield Ia.createTempDirectory(),u=PT.join(d,Ia.getCacheFileName(p));Mt.debug(`Archive Path: ${u}`);try{yield(0,C1.createTar)(d,c,p),Mt.isDebug()&&(yield(0,C1.listTar)(u,p));let m=10*1024*1024*1024,f=Ia.getArchiveFileSizeInBytes(u);if(Mt.debug(`File Size: ${f}`),f>m&&!Ia.isGhes())throw new Error(`Cache size of ~${Math.round(f/(1024*1024))} MB (${f} B) is over the 10GB limit, not saving cache.`);Mt.debug("Reserving Cache");let B=yield E1.reserveCache(e,t,{compressionMethod:p,enableCrossOsArchive:a,cacheSize:f});if(!((r=B?.result)===null||r===void 0)&&r.cacheId)l=(n=B?.result)===null||n===void 0?void 0:n.cacheId;else throw B?.statusCode===400?new Error((o=(s=B?.error)===null||s===void 0?void 0:s.message)!==null&&o!==void 0?o:`Cache size of ~${Math.round(f/(1024*1024))} MB (${f} B) is over the data cap limit, not saving cache.`):new ql(`Unable to reserve cache with key ${e}, another job may be creating this cache. More details: ${(A=B?.error)===null||A===void 0?void 0:A.message}`);Mt.debug(`Saving Cache (ID: ${l})`),yield E1.saveCache(l,u,i)}catch(m){let f=m;if(f.name===Jr.name)throw m;f.name===ql.name?Mt.info(`Failed to save: ${f.message}`):Mt.warning(`Failed to save: ${f.message}`)}finally{try{yield Ia.unlinkFile(u)}catch(m){Mt.debug(`Failed to delete archive: ${m}`)}}return l})}St.saveCache=mne});var zT=Wr(HT()),B1=Wr(Ra());(async()=>{let t=JSON.parse((0,B1.getState)("cache"));if(t.cacheEnabled&&!t.cacheHit)try{await(0,zT.saveCache)([t.bunPath],t.url)}catch{(0,B1.warning)("Failed to save Bun to cache.")}})(); +`));let a=yield R4(i,"create");yield S4(a,t)})}di.createTar=pne});var HT=v(St=>{"use strict";var lne=St&&St.__createBinding||(Object.create?function(t,e,i,a){a===void 0&&(a=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,a,r)}:function(t,e,i,a){a===void 0&&(a=i),t[a]=e[i]}),cne=St&&St.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y1=St&&St.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&lne(e,t,i);return cne(e,t),e},MT=St&&St.__awaiter||function(t,e,i,a){function r(n){return n instanceof i?n:new i(function(s){s(n)})}return new(i||(i=Promise))(function(n,s){function o(l){try{p(a.next(l))}catch(c){s(c)}}function A(l){try{p(a.throw(l))}catch(c){s(c)}}function p(l){l.done?n(l.value):r(l.value).then(o,A)}p((a=a.apply(t,e||[])).next())})};Object.defineProperty(St,"__esModule",{value:!0});St.saveCache=St.restoreCache=St.isFeatureAvailable=St.ReserveCacheError=St.ValidationError=void 0;var Mt=y1(Ra()),PT=y1(require("path")),Ia=y1(Mp()),E1=y1(_T()),C1=OT(),Jr=class t extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}};St.ValidationError=Jr;var ql=class t extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}};St.ReserveCacheError=ql;function UT(t){if(!t||t.length===0)throw new Jr("Path Validation Error: At least one directory or file path is required")}function qT(t){if(t.length>512)throw new Jr(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new Jr(`Key Validation Error: ${t} cannot contain commas.`)}function dne(){return!!process.env.ACTIONS_CACHE_URL}St.isFeatureAvailable=dne;function une(t,e,i,a,r=!1){return MT(this,void 0,void 0,function*(){UT(t),i=i||[];let n=[e,...i];if(Mt.debug("Resolved Keys:"),Mt.debug(JSON.stringify(n)),n.length>10)throw new Jr("Key Validation Error: Keys are limited to a maximum of 10.");for(let A of n)qT(A);let s=yield Ia.getCompressionMethod(),o="";try{let A=yield E1.getCacheEntry(n,t,{compressionMethod:s,enableCrossOsArchive:r});if(!A?.archiveLocation)return;if(a?.lookupOnly)return Mt.info("Lookup only - skipping download"),A.cacheKey;o=PT.join(yield Ia.createTempDirectory(),Ia.getCacheFileName(s)),Mt.debug(`Archive Path: ${o}`),yield E1.downloadCache(A.archiveLocation,o,a),Mt.isDebug()&&(yield(0,C1.listTar)(o,s));let p=Ia.getArchiveFileSizeInBytes(o);return Mt.info(`Cache Size: ~${Math.round(p/(1024*1024))} MB (${p} B)`),yield(0,C1.extractTar)(o,s),Mt.info("Cache restored successfully"),A.cacheKey}catch(A){if(A.name===Jr.name)throw A;Mt.warning(`Failed to restore: ${A.message}`)}finally{try{yield Ia.unlinkFile(o)}catch(A){Mt.debug(`Failed to delete archive: ${A}`)}}})}St.restoreCache=une;function mne(t,e,i,a=!1){var r,n,s,o,A;return MT(this,void 0,void 0,function*(){UT(t),qT(e);let p=yield Ia.getCompressionMethod(),l=-1,c=yield Ia.resolvePaths(t);if(Mt.debug("Cache Paths:"),Mt.debug(`${JSON.stringify(c)}`),c.length===0)throw new Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let d=yield Ia.createTempDirectory(),u=PT.join(d,Ia.getCacheFileName(p));Mt.debug(`Archive Path: ${u}`);try{yield(0,C1.createTar)(d,c,p),Mt.isDebug()&&(yield(0,C1.listTar)(u,p));let m=10*1024*1024*1024,f=Ia.getArchiveFileSizeInBytes(u);if(Mt.debug(`File Size: ${f}`),f>m&&!Ia.isGhes())throw new Error(`Cache size of ~${Math.round(f/(1024*1024))} MB (${f} B) is over the 10GB limit, not saving cache.`);Mt.debug("Reserving Cache");let B=yield E1.reserveCache(e,t,{compressionMethod:p,enableCrossOsArchive:a,cacheSize:f});if(!((r=B?.result)===null||r===void 0)&&r.cacheId)l=(n=B?.result)===null||n===void 0?void 0:n.cacheId;else throw B?.statusCode===400?new Error((o=(s=B?.error)===null||s===void 0?void 0:s.message)!==null&&o!==void 0?o:`Cache size of ~${Math.round(f/(1024*1024))} MB (${f} B) is over the data cap limit, not saving cache.`):new ql(`Unable to reserve cache with key ${e}, another job may be creating this cache. More details: ${(A=B?.error)===null||A===void 0?void 0:A.message}`);Mt.debug(`Saving Cache (ID: ${l})`),yield E1.saveCache(l,u,i)}catch(m){let f=m;if(f.name===Jr.name)throw m;f.name===ql.name?Mt.info(`Failed to save: ${f.message}`):Mt.warning(`Failed to save: ${f.message}`)}finally{try{yield Ia.unlinkFile(u)}catch(m){Mt.debug(`Failed to delete archive: ${m}`)}}return l})}St.saveCache=mne});var zT=Wr(HT()),B1=Wr(Ra());(async()=>{let t=JSON.parse((0,B1.getState)("cache"));if(t.cacheEnabled&&!t.cacheHit)try{await(0,zT.saveCache)([t.bunPath],t.url),process.exit(0)}catch{(0,B1.warning)("Failed to save Bun to cache.")}})(); /*! Bundled license information: undici/lib/fetch/body.js: diff --git a/src/cache-save.ts b/src/cache-save.ts index 0bdfc5c..ebaf2c4 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -7,7 +7,7 @@ import { CacheState } from "./action"; if (state.cacheEnabled && !state.cacheHit) { try { await saveCache([state.bunPath], state.url); - //process.exit(0); + process.exit(0); } catch (error) { warning("Failed to save Bun to cache."); }