diff --git a/dist/setup/index.js b/dist/setup/index.js index f0a5d4f..c265a9d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -46,7 +46,7 @@ ${o}:${decodeURIComponent(n[o])}`}return i}},$e=class extends Hs{constructor(e,a Other caches with similar key:`);for(let o of n?.artifactCaches||[])Wt.debug(`Cache Key: ${o?.cacheKey}, Cache Version: ${o?.cacheVersion}, Cache Scope: ${o?.scope}, Cache Created: ${o?.creationTime}`)}}})}function LA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=new IA.URL(t),r=(0,Nv.getDownloadOptions)(a);i.hostname.endsWith(".blob.core.windows.net")?r.useAzureSdk?yield(0,al.downloadCacheStorageSDK)(t,e,r):r.concurrentBlobDownloads?yield(0,al.downloadCacheHttpClientConcurrent)(t,e,r):yield(0,al.downloadCacheHttpClient)(t,e):yield(0,al.downloadCacheHttpClient)(t,e)})}Qe.downloadCache=LA;function jA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=_0(),r=S0(e,a?.compressionMethod,a?.enableCrossOsArchive),n={key:t,version:r,cacheSize:a?.cacheSize};return yield(0,$i.retryTypedResponse)("reserveCache",()=>Ht(this,void 0,void 0,function*(){return i.postJson(ro("caches"),n)}))})}Qe.reserveCache=jA;function wv(t,e){return`bytes ${t}-${e}/*`}function kA(t,e,a,i,r){return Ht(this,void 0,void 0,function*(){Wt.debug(`Uploading chunk of size ${r-i+1} bytes at offset ${i} with content range: ${wv(i,r)}`);let n={"Content-Type":"application/octet-stream","Content-Range":wv(i,r)},s=yield(0,$i.retryHttpClientResponse)(`uploadChunk (start: ${i}, end: ${r})`,()=>Ht(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,a(),n)}));if(!(0,$i.isSuccessStatusCode)(s.message.statusCode))throw new Error(`Cache service responded with ${s.message.statusCode} during upload chunk.`)})}function HA(t,e,a,i){return Ht(this,void 0,void 0,function*(){let r=il.getArchiveFileSizeInBytes(a),n=ro(`caches/${e.toString()}`),s=N0.openSync(a,"r"),o=(0,Nv.getUploadOptions)(i),p=il.assertDefined("uploadConcurrency",o.uploadConcurrency),d=il.assertDefined("uploadChunkSize",o.uploadChunkSize),l=[...new Array(p).keys()];Wt.debug("Awaiting all uploads");let c=0;try{yield Promise.all(l.map(()=>Ht(this,void 0,void 0,function*(){for(;cN0.createReadStream(a,{fd:s,start:u,end:g,autoClose:!1}).on("error",x=>{throw new Error(`Cache upload failed because file read failed with ${x.message}`)}),u,g)}})))}finally{N0.closeSync(s)}})}function UA(t,e,a){return Ht(this,void 0,void 0,function*(){let i={size:a};return yield(0,$i.retryTypedResponse)("commitCache",()=>Ht(this,void 0,void 0,function*(){return t.postJson(ro(`caches/${e.toString()}`),i)}))})}function FA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=_0();Wt.debug("Upload cache"),yield HA(i,t,e,a),Wt.debug("Commiting cache");let r=il.getArchiveFileSizeInBytes(e);Wt.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);let n=yield UA(i,t,r);if(!(0,$i.isSuccessStatusCode)(n.statusCode))throw new Error(`Cache service responded with ${n.statusCode} during commit cache.`);Wt.info("Cache saved successfully")})}Qe.saveCache=FA});var Cv=P(St=>{"use strict";var VA=St&&St.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),$A=St&&St.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E0=St&&St.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&VA(e,t,a);return $A(e,t),e},pi=St&&St.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(St,"__esModule",{value:!0});St.createTar=St.extractTar=St.listTar=void 0;var GA=Hn(),nl=E0(kn()),Sv=require("fs"),Na=E0(require("path")),C0=E0(as()),Ie=es(),Gi=process.platform==="win32";function XA(){return pi(this,void 0,void 0,function*(){switch(process.platform){case"win32":{let t=yield C0.getGnuTarPathOnWindows(),e=Ie.SystemTarPathOnWindows;if(t)return{path:t,type:Ie.ArchiveToolType.GNU};if((0,Sv.existsSync)(e))return{path:e,type:Ie.ArchiveToolType.BSD};break}case"darwin":{let t=yield nl.which("gtar",!1);return t?{path:t,type:Ie.ArchiveToolType.GNU}:{path:yield nl.which("tar",!0),type:Ie.ArchiveToolType.BSD}}default:break}return{path:yield nl.which("tar",!0),type:Ie.ArchiveToolType.GNU}})}function WA(t,e,a,i=""){return pi(this,void 0,void 0,function*(){let r=[`"${t.path}"`],n=C0.getCacheFileName(e),s="cache.tar",o=Ev(),p=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(a){case"create":r.push("--posix","-cf",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--exclude",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--files-from",Ie.ManifestFilename);break;case"extract":r.push("-xf",p?s:i.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Na.sep}`,"g"),"/"));break;case"list":r.push("-tf",p?s:i.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P");break}if(t.type===Ie.ArchiveToolType.GNU)switch(process.platform){case"win32":r.push("--force-local");break;case"darwin":r.push("--delay-directory-restore");break}return r})}function T0(t,e,a=""){return pi(this,void 0,void 0,function*(){let i,r=yield XA(),n=yield WA(r,t,e,a),s=e!=="create"?yield KA(r,t,a):yield QA(r,t),o=r.type===Ie.ArchiveToolType.BSD&&t!==Ie.CompressionMethod.Gzip&&Gi;return o&&e!=="create"?i=[[...s].join(" "),[...n].join(" ")]:i=[[...n].join(" "),[...s].join(" ")],o?i:[i.join(" ")]})}function Ev(){var t;return(t=process.env.GITHUB_WORKSPACE)!==null&&t!==void 0?t:process.cwd()}function KA(t,e,a){return pi(this,void 0,void 0,function*(){let i=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(e){case Ie.CompressionMethod.Zstd:return i?["zstd -d --long=30 --force -o",Ie.TarFilename,a.replace(new RegExp(`\\${Na.sep}`,"g"),"/")]:["--use-compress-program",Gi?'"zstd -d --long=30"':"unzstd --long=30"];case Ie.CompressionMethod.ZstdWithoutLong:return i?["zstd -d --force -o",Ie.TarFilename,a.replace(new RegExp(`\\${Na.sep}`,"g"),"/")]:["--use-compress-program",Gi?'"zstd -d"':"unzstd"];default:return["-z"]}})}function QA(t,e){return pi(this,void 0,void 0,function*(){let a=C0.getCacheFileName(e),i=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(e){case Ie.CompressionMethod.Zstd:return i?["zstd -T0 --long=30 --force -o",a.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),Ie.TarFilename]:["--use-compress-program",Gi?'"zstd -T0 --long=30"':"zstdmt --long=30"];case Ie.CompressionMethod.ZstdWithoutLong:return i?["zstd -T0 --force -o",a.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),Ie.TarFilename]:["--use-compress-program",Gi?'"zstd -T0"':"zstdmt"];default:return["-z"]}})}function P0(t,e){return pi(this,void 0,void 0,function*(){for(let a of t)try{yield(0,GA.exec)(a,void 0,{cwd:e,env:Object.assign(Object.assign({},process.env),{MSYS:"winsymlinks:nativestrict"})})}catch(i){throw new Error(`${a.split(" ")[0]} failed with error: ${i?.message}`)}})}function YA(t,e){return pi(this,void 0,void 0,function*(){let a=yield T0(e,"list",t);yield P0(a)})}St.listTar=YA;function ZA(t,e){return pi(this,void 0,void 0,function*(){let a=Ev();yield nl.mkdirP(a);let i=yield T0(e,"extract",t);yield P0(i)})}St.extractTar=ZA;function JA(t,e,a){return pi(this,void 0,void 0,function*(){(0,Sv.writeFileSync)(Na.join(t,Ie.ManifestFilename),e.join(` `));let i=yield T0(a,"create");yield P0(i,t)})}St.createTar=JA});var Dv=P(Ye=>{"use strict";var ez=Ye&&Ye.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),tz=Ye&&Ye.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pl=Ye&&Ye.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&ez(e,t,a);return tz(e,t),e},Tv=Ye&&Ye.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.saveCache=Ye.restoreCache=Ye.isFeatureAvailable=Ye.ReserveCacheError=Ye.ValidationError=void 0;var it=pl(nt()),Pv=pl(require("path")),pa=pl(as()),sl=pl(_v()),ol=Cv(),di=class t extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}};Ye.ValidationError=di;var no=class t extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}};Ye.ReserveCacheError=no;function Ov(t){if(!t||t.length===0)throw new di("Path Validation Error: At least one directory or file path is required")}function Rv(t){if(t.length>512)throw new di(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new di(`Key Validation Error: ${t} cannot contain commas.`)}function az(){return!!process.env.ACTIONS_CACHE_URL}Ye.isFeatureAvailable=az;function iz(t,e,a,i,r=!1){return Tv(this,void 0,void 0,function*(){Ov(t),a=a||[];let n=[e,...a];if(it.debug("Resolved Keys:"),it.debug(JSON.stringify(n)),n.length>10)throw new di("Key Validation Error: Keys are limited to a maximum of 10.");for(let p of n)Rv(p);let s=yield pa.getCompressionMethod(),o="";try{let p=yield sl.getCacheEntry(n,t,{compressionMethod:s,enableCrossOsArchive:r});if(!p?.archiveLocation)return;if(i?.lookupOnly)return it.info("Lookup only - skipping download"),p.cacheKey;o=Pv.join(yield pa.createTempDirectory(),pa.getCacheFileName(s)),it.debug(`Archive Path: ${o}`),yield sl.downloadCache(p.archiveLocation,o,i),it.isDebug()&&(yield(0,ol.listTar)(o,s));let d=pa.getArchiveFileSizeInBytes(o);return it.info(`Cache Size: ~${Math.round(d/(1024*1024))} MB (${d} B)`),yield(0,ol.extractTar)(o,s),it.info("Cache restored successfully"),p.cacheKey}catch(p){if(p.name===di.name)throw p;it.warning(`Failed to restore: ${p.message}`)}finally{try{yield pa.unlinkFile(o)}catch(p){it.debug(`Failed to delete archive: ${p}`)}}})}Ye.restoreCache=iz;function rz(t,e,a,i=!1){var r,n,s,o,p;return Tv(this,void 0,void 0,function*(){Ov(t),Rv(e);let d=yield pa.getCompressionMethod(),l=-1,c=yield pa.resolvePaths(t);if(it.debug("Cache Paths:"),it.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 m=yield pa.createTempDirectory(),u=Pv.join(m,pa.getCacheFileName(d));it.debug(`Archive Path: ${u}`);try{yield(0,ol.createTar)(m,c,d),it.isDebug()&&(yield(0,ol.listTar)(u,d));let g=10*1024*1024*1024,x=pa.getArchiveFileSizeInBytes(u);if(it.debug(`File Size: ${x}`),x>g&&!pa.isGhes())throw new Error(`Cache size of ~${Math.round(x/(1024*1024))} MB (${x} B) is over the 10GB limit, not saving cache.`);it.debug("Reserving Cache");let N=yield sl.reserveCache(e,t,{compressionMethod:d,enableCrossOsArchive:i,cacheSize:x});if(!((r=N?.result)===null||r===void 0)&&r.cacheId)l=(n=N?.result)===null||n===void 0?void 0:n.cacheId;else throw N?.statusCode===400?new Error((o=(s=N?.error)===null||s===void 0?void 0:s.message)!==null&&o!==void 0?o:`Cache size of ~${Math.round(x/(1024*1024))} MB (${x} B) is over the data cap limit, not saving cache.`):new no(`Unable to reserve cache with key ${e}, another job may be creating this cache. More details: ${(p=N?.error)===null||p===void 0?void 0:p.message}`);it.debug(`Saving Cache (ID: ${l})`),yield sl.saveCache(l,u,a)}catch(g){let x=g;if(x.name===di.name)throw g;x.name===no.name?it.info(`Failed to save: ${x.message}`):it.warning(`Failed to save: ${x.message}`)}finally{try{yield pa.unlinkFile(u)}catch(g){it.debug(`Failed to delete archive: ${g}`)}}return l})}Ye.saveCache=rz});var Av=P((Et,R0)=>{"use strict";var nz=Et&&Et.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),sz=Et&&Et.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oz=Et&&Et.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&nz(e,t,a);return sz(e,t),e},pz=Et&&Et.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Et,"__esModule",{value:!0});Et._readLinuxVersionFile=Et._getOsVersion=Et._findMatch=void 0;var Iv=oz(Lo()),O0=nt(),Bv=require("os"),dz=require("child_process"),dl=require("fs");function lz(t,e,a,i){return pz(this,void 0,void 0,function*(){let r=Bv.platform(),n,s,o;for(let p of a){let d=p.version;if(O0.debug(`check ${d} satisfies ${t}`),Iv.satisfies(d,t)&&(!e||p.stable===e)&&(o=p.files.find(l=>{O0.debug(`${l.arch}===${i} && ${l.platform}===${r}`);let c=l.arch===i&&l.platform===r;if(c&&l.platform_version){let m=R0.exports._getOsVersion();m===l.platform_version?c=!0:c=Iv.satisfies(m,l.platform_version)}return c}),o)){O0.debug(`matched ${p.version}`),s=p;break}}return s&&o&&(n=Object.assign({},s),n.files=[o]),n})}Et._findMatch=lz;function cz(){let t=Bv.platform(),e="";if(t==="darwin")e=dz.execSync("sw_vers -productVersion").toString();else if(t==="linux"){let a=R0.exports._readLinuxVersionFile();if(a){let i=a.split(` `);for(let r of i){let n=r.split("=");if(n.length===2&&(n[0].trim()==="VERSION_ID"||n[0].trim()==="DISTRIB_RELEASE")){e=n[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}Et._getOsVersion=cz;function mz(){let t="/etc/lsb-release",e="/etc/os-release",a="";return dl.existsSync(t)?a=dl.readFileSync(t).toString():dl.existsSync(e)&&(a=dl.readFileSync(e).toString()),a}Et._readLinuxVersionFile=mz});var qv=P(da=>{"use strict";var uz=da&&da.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),fz=da&&da.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hz=da&&da.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&uz(e,t,a);return fz(e,t),e},zv=da&&da.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(da,"__esModule",{value:!0});da.RetryHelper=void 0;var Mv=hz(nt()),D0=class{constructor(e,a,i){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(a),this.maxSeconds=Math.floor(i),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,a){return zv(this,void 0,void 0,function*(){let i=1;for(;isetTimeout(a,e*1e3))})}};da.RetryHelper=D0});var $v=P(ne=>{"use strict";var gz=ne&&ne.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),yz=ne&&ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ka=ne&&ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&gz(e,t,a);return yz(e,t),e},Ot=ne&&ne.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})},vz=ne&&ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ne,"__esModule",{value:!0});ne.evaluateVersions=ne.isExplicitVersion=ne.findFromManifest=ne.getManifestFromRepo=ne.findAllVersions=ne.find=ne.cacheFile=ne.cacheDir=ne.extractZip=ne.extractXar=ne.extractTar=ne.extract7z=ne.downloadTool=ne.HTTPError=void 0;var he=ka(nt()),Kt=ka(kn()),la=ka(require("fs")),xz=ka(Av()),oo=ka(require("os")),_a=ka(require("path")),Lv=ka(Rr()),li=ka(Lo()),bz=ka(require("stream")),wz=ka(require("util")),Dn=require("assert"),jv=vz(wc()),Xi=Hn(),Nz=qv(),so=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};ne.HTTPError=so;var B0=process.platform==="win32",_z=process.platform==="darwin",Sz="actions/tool-cache";function Ez(t,e,a,i){return Ot(this,void 0,void 0,function*(){e=e||_a.join(Vv(),jv.default()),yield Kt.mkdirP(_a.dirname(e)),he.debug(`Downloading ${t}`),he.debug(`Destination ${e}`);let r=3,n=I0("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),s=I0("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new Nz.RetryHelper(r,n,s).execute(()=>Ot(this,void 0,void 0,function*(){return yield Cz(t,e||"",a,i)}),p=>!(p instanceof so&&p.httpStatusCode&&p.httpStatusCode<500&&p.httpStatusCode!==408&&p.httpStatusCode!==429))})}ne.downloadTool=Ez;function Cz(t,e,a,i){return Ot(this,void 0,void 0,function*(){if(la.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let r=new Lv.HttpClient(Sz,[],{allowRetries:!1});a&&(he.debug("set auth"),i===void 0&&(i={}),i.authorization=a);let n=yield r.get(t,i);if(n.message.statusCode!==200){let l=new so(n.message.statusCode);throw he.debug(`Failed to download from "${t}". Code(${n.message.statusCode}) Message(${n.message.statusMessage})`),l}let s=wz.promisify(bz.pipeline),p=I0("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>n.message)(),d=!1;try{return yield s(p,la.createWriteStream(e)),he.debug("download complete"),d=!0,e}finally{if(!d){he.debug("download failed");try{yield Kt.rmRF(e)}catch(l){he.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function Tz(t,e,a){return Ot(this,void 0,void 0,function*(){Dn.ok(B0,"extract7z() not supported on current OS"),Dn.ok(t,'parameter "file" is required'),e=yield ll(e);let i=process.cwd();if(process.chdir(e),a)try{let n=["x",he.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",t],s={silent:!0};yield Xi.exec(`"${a}"`,n,s)}finally{process.chdir(i)}else{let r=_a.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),p=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${r}' -Source '${n}' -Target '${s}'`],d={silent:!0};try{let l=yield Kt.which("powershell",!0);yield Xi.exec(`"${l}"`,p,d)}finally{process.chdir(i)}}return e})}ne.extract7z=Tz;function Pz(t,e,a="xz"){return Ot(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");e=yield ll(e),he.debug("Checking tar --version");let i="";yield Xi.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:p=>i+=p.toString(),stderr:p=>i+=p.toString()}}),he.debug(i.trim());let r=i.toUpperCase().includes("GNU TAR"),n;a instanceof Array?n=a:n=[a],he.isDebug()&&!a.includes("v")&&n.push("-v");let s=e,o=t;return B0&&r&&(n.push("--force-local"),s=e.replace(/\\/g,"/"),o=t.replace(/\\/g,"/")),r&&(n.push("--warning=no-unknown-keyword"),n.push("--overwrite")),n.push("-C",s,"-f",o),yield Xi.exec("tar",n),e})}ne.extractTar=Pz;function Oz(t,e,a=[]){return Ot(this,void 0,void 0,function*(){Dn.ok(_z,"extractXar() not supported on current OS"),Dn.ok(t,'parameter "file" is required'),e=yield ll(e);let i;a instanceof Array?i=a:i=[a],i.push("-x","-C",e,"-f",t),he.isDebug()&&i.push("-v");let r=yield Kt.which("xar",!0);return yield Xi.exec(`"${r}"`,Lz(i)),e})}ne.extractXar=Oz;function Rz(t,e){return Ot(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");return e=yield ll(e),B0?yield Dz(t,e):yield Iz(t,e),e})}ne.extractZip=Rz;function Dz(t,e){return Ot(this,void 0,void 0,function*(){let a=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=yield Kt.which("pwsh",!1);if(r){let s=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force } else { throw $_ } } ;`].join(" ")];he.debug(`Using pwsh at path: ${r}`),yield Xi.exec(`"${r}"`,s)}else{let s=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`].join(" ")],o=yield Kt.which("powershell",!0);he.debug(`Using powershell at path: ${o}`),yield Xi.exec(`"${o}"`,s)}})}function Iz(t,e){return Ot(this,void 0,void 0,function*(){let a=yield Kt.which("unzip",!0),i=[t];he.isDebug()||i.unshift("-q"),i.unshift("-o"),yield Xi.exec(`"${a}"`,i,{cwd:e})})}function Bz(t,e,a,i){return Ot(this,void 0,void 0,function*(){if(a=li.clean(a)||a,i=i||oo.arch(),he.debug(`Caching tool ${e} ${a} ${i}`),he.debug(`source dir: ${t}`),!la.statSync(t).isDirectory())throw new Error("sourceDir is not a directory");let r=yield Hv(e,a,i);for(let n of la.readdirSync(t)){let s=_a.join(t,n);yield Kt.cp(s,r,{recursive:!0})}return Uv(e,a,i),r})}ne.cacheDir=Bz;function Az(t,e,a,i,r){return Ot(this,void 0,void 0,function*(){if(i=li.clean(i)||i,r=r||oo.arch(),he.debug(`Caching tool ${a} ${i} ${r}`),he.debug(`source file: ${t}`),!la.statSync(t).isFile())throw new Error("sourceFile is not a file");let n=yield Hv(a,i,r),s=_a.join(n,e);return he.debug(`destination file ${s}`),yield Kt.cp(t,s),Uv(a,i,r),n})}ne.cacheFile=Az;function zz(t,e,a){if(!t)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(a=a||oo.arch(),!A0(e)){let r=kv(t,a);e=Fv(r,e)}let i="";if(e){e=li.clean(e)||"";let r=_a.join(cl(),t,e,a);he.debug(`checking cache: ${r}`),la.existsSync(r)&&la.existsSync(`${r}.complete`)?(he.debug(`Found tool in cache ${t} ${e} ${a}`),i=r):he.debug("not found")}return i}ne.find=zz;function kv(t,e){let a=[];e=e||oo.arch();let i=_a.join(cl(),t);if(la.existsSync(i)){let r=la.readdirSync(i);for(let n of r)if(A0(n)){let s=_a.join(i,n,e||"");la.existsSync(s)&&la.existsSync(`${s}.complete`)&&a.push(n)}}return a}ne.findAllVersions=kv;function Mz(t,e,a,i="master"){return Ot(this,void 0,void 0,function*(){let r=[],n=`https://api.github.com/repos/${t}/${e}/git/trees/${i}`,s=new Lv.HttpClient("tool-cache"),o={};a&&(he.debug("set auth"),o.authorization=a);let p=yield s.getJson(n,o);if(!p.result)return r;let d="";for(let c of p.result.tree)if(c.path==="versions-manifest.json"){d=c.url;break}o.accept="application/vnd.github.VERSION.raw";let l=yield(yield s.get(d,o)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{r=JSON.parse(l)}catch{he.debug("Invalid json")}}return r})}ne.getManifestFromRepo=Mz;function qz(t,e,a,i=oo.arch()){return Ot(this,void 0,void 0,function*(){return yield xz._findMatch(t,e,a,i)})}ne.findFromManifest=qz;function ll(t){return Ot(this,void 0,void 0,function*(){return t||(t=_a.join(Vv(),jv.default())),yield Kt.mkdirP(t),t})}function Hv(t,e,a){return Ot(this,void 0,void 0,function*(){let i=_a.join(cl(),t,li.clean(e)||e,a||"");he.debug(`destination ${i}`);let r=`${i}.complete`;return yield Kt.rmRF(i),yield Kt.rmRF(r),yield Kt.mkdirP(i),i})}function Uv(t,e,a){let r=`${_a.join(cl(),t,li.clean(e)||e,a||"")}.complete`;la.writeFileSync(r,""),he.debug("finished caching tool")}function A0(t){let e=li.clean(t)||"";he.debug(`isExplicit: ${e}`);let a=li.valid(e)!=null;return he.debug(`explicit? ${a}`),a}ne.isExplicitVersion=A0;function Fv(t,e){let a="";he.debug(`evaluating ${t.length} versions`),t=t.sort((i,r)=>li.gt(i,r)?1:-1);for(let i=t.length-1;i>=0;i--){let r=t[i];if(li.satisfies(r,e)){a=r;break}}return a?he.debug(`matched: ${a}`):he.debug("match not found"),a}ne.evaluateVersions=Fv;function cl(){let t=process.env.RUNNER_TOOL_CACHE||"";return Dn.ok(t,"Expected RUNNER_TOOL_CACHE to be defined"),t}function Vv(){let t=process.env.RUNNER_TEMP||"";return Dn.ok(t,"Expected RUNNER_TEMP to be defined"),t}function I0(t,e){let a=global[t];return a!==void 0?a:e}function Lz(t){return Array.from(new Set(t))}});var ax=P((ul,tx)=>{(function(t,e){typeof ul=="object"&&typeof tx<"u"?e(ul):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.compareVersions={}))})(ul,function(t){"use strict";let e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,a=N=>{if(typeof N!="string")throw new TypeError("Invalid argument expected string");let _=N.match(e);if(!_)throw new Error(`Invalid argument not valid semver ('${N}' received)`);return _.shift(),_},i=N=>N==="*"||N==="x"||N==="X",r=N=>{let _=parseInt(N,10);return isNaN(_)?N:_},n=(N,_)=>typeof N!=typeof _?[String(N),String(_)]:[N,_],s=(N,_)=>{if(i(N)||i(_))return 0;let[T,v]=n(r(N),r(_));return T>v?1:T{for(let T=0;T{let T=a(N),v=a(_),h=T.pop(),f=v.pop(),S=o(T,v);return S!==0?S:h&&f?o(h.split("."),f.split(".")):h||f?h?-1:1:0},d=(N,_,T)=>{m(T);let v=p(N,_);return l[T].includes(v)},l={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},c=Object.keys(l),m=N=>{if(typeof N!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof N}`);if(c.indexOf(N)===-1)throw new Error(`Invalid operator, expected one of ${c.join("|")}`)},u=(N,_)=>{if(_=_.replace(/([><=]+)\s+/g,"$1"),_.includes("||"))return _.split("||").some(F=>u(N,F));if(_.includes(" - ")){let[F,Ae]=_.split(" - ",2);return u(N,`>=${F} <=${Ae}`)}else if(_.includes(" "))return _.trim().replace(/\s{2,}/g," ").split(" ").every(F=>u(N,F));let T=_.match(/^([<>=~^]+)/),v=T?T[1]:"=";if(v!=="^"&&v!=="~")return d(N,_,v);let[h,f,S,,C]=a(N),[w,D,E,,R]=a(_),B=[h,f,S],L=[w,D??"x",E??"x"];if(R&&(!C||o(B,L)!==0||o(C.split("."),R.split("."))===-1))return!1;let ie=L.findIndex(F=>F!=="0")+1,se=v==="~"?2:ie>1?ie:1;return!(o(B.slice(0,se),L.slice(0,se))!==0||o(B.slice(se),L.slice(se))===-1)},g=N=>typeof N=="string"&&/^[v\d]/.test(N)&&e.test(N),x=N=>typeof N=="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(N);t.compare=d,t.compareVersions=p,t.satisfies=u,t.validate=g,t.validateStrict=x})});var ox=require("node:os"),Nt=Ct(nt());var ix=require("node:os"),An=require("node:path"),Ha=require("node:fs"),_r=Ct(nt()),fl=Ct(Dv()),lo=Ct($v()),z0=Ct(Hn());var po=require("node:os"),Gv=require("node:fs"),Xv=Ct(nt());function jz(t){let{registryUrl:e,scope:a}=t,i;if(e)try{i=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let r;return a&&(r=a.startsWith("@")?a.toLocaleLowerCase():`@${a.toLocaleLowerCase()}`),i&&r?`[install.scopes]${po.EOL}'${r}' = { token = "$BUN_AUTH_TOKEN", url = "${i}"}${po.EOL}`:i&&!r?`[install]${po.EOL}registry = "${i}"${po.EOL}`:null}function Wv(t,e){let a=jz(e);a&&((0,Xv.info)(`Writing bunfig.toml to '${t}'.`),(0,Gv.appendFileSync)(t,a,{encoding:"utf8"}))}var rx=Ct(nt());var In=Ct(nt()),Kv=require("node:console"),Bn=require("node:fs"),ml=require("node:path");async function Qv(t,e){let a=await fetch(t,e);if(!a.ok)throw new Error(`Failed to fetch url ${t}. (status code: ${a.status}, status text: ${a.statusText}) -${a}`);return a}function Yv(t,e){return t.endsWith(e)?t:((0,Bn.renameSync)(t,t+e),t+e)}function Zv(){let t=process.platform;return t==="win32"?"windows":t}function Jv(){let t=process.arch;return t==="arm64"?"aarch64":t}var kz={"package.json":t=>JSON.parse(t).packageManager?.split("bun@")?.[1],".tool-versions":t=>t.match(/^bun\s?(?.*?)$/m)?.groups?.version,".bumrc":t=>t,".bun-version":t=>t};function ex(t){let e=process.env.GITHUB_WORKSPACE;if(!e||!t)return;(0,In.debug)(`Reading version from ${t}`);let a=(0,ml.join)(e,t),i=(0,ml.basename)(t);if(!(0,Bn.existsSync)(a)){(0,In.warning)(`File ${a} not found`);return}let r=kz[i]??(()=>{}),n;try{if(n=r((0,Bn.readFileSync)(a,"utf8"))?.trim(),!n){(0,In.warning)(`Failed to read version from ${t}`);return}}catch(s){let{message:o}=s;(0,In.warning)(`Failed to read ${t}: ${o}`)}finally{if(n)return(0,Kv.info)(`Obtained version ${n} from ${t}`),n}}var Sr=Ct(ax()),nx=async t=>{let e=(0,An.join)(process.cwd(),"bunfig.toml");Wv(e,t);let a=await Fz(t),i=Uz(t),r=(0,An.join)((0,ix.homedir)(),".bun","bin");try{(0,Ha.mkdirSync)(r,{recursive:!0})}catch(c){if(c.code!=="EEXIST")throw c}(0,_r.addPath)(r);let n=c=>process.platform==="win32"?`${c}.exe`:c,s=(0,An.join)(r,n("bun"));try{(0,Ha.symlinkSync)(s,(0,An.join)(r,n("bunx")))}catch(c){if(c.code!=="EEXIST")throw c}let o,p=!1;if(i&&await(0,fl.restoreCache)([s],a)&&(o=await sx(s),o?(p=!0,(0,_r.info)(`Using a cached version of Bun: ${o}`)):(0,_r.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),p||((0,_r.info)(`Downloading a new version of Bun: ${a}`),o=await Hz(a,s)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[d]=o.split("+");return(0,rx.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:p,bunPath:s,url:a})),{version:d,revision:o,bunPath:s,url:a,cacheHit:p}};async function Hz(t,e){let a=Yv(await(0,lo.downloadTool)(t),".zip"),i=await(0,lo.extractZip)(a),r=await M0(i);try{(0,Ha.renameSync)(r,e)}catch{(0,Ha.copyFileSync)(r,e)}return await sx(e)}function Uz(t){let{customUrl:e,version:a,noCache:i}=t;return i||e||!a||/latest|canary|action/i.test(a)?!1:(0,fl.isFeatureAvailable)()}async function Fz(t){let{customUrl:e}=t;if(e)return e;let i=(await(await Qv("https://api.github.com/repos/oven-sh/bun/git/refs/tags",{headers:{Authorization:`Bearer ${t.token}`}})).json()).filter(N=>N.ref.startsWith("refs/tags/bun-v")||N.ref==="refs/tags/canary").map(N=>N.ref.replace(/refs\/tags\/(bun-v)?/g,"")),{version:r,os:n,arch:s,avx2:o,profile:p}=t,d=i.find(N=>N===r);d||(i=i.filter(N=>(0,Sr.validate)(N)).sort(Sr.compareVersions),r==="latest"?d=`bun-v${i.at(-1)}`:d=`bun-v${i.filter(N=>(0,Sr.satisfies)(N,r)).at(-1)}`),(0,Sr.validate)(d)&&(d=`bun-v${d}`);let l=encodeURIComponent(d??r),c=encodeURIComponent(n??Zv()),m=encodeURIComponent(s??Jv()),u=encodeURIComponent(o?"-baseline":""),g=encodeURIComponent(p?"-profile":""),{href:x}=new URL(`${l}/bun-${c}-${m}${u}${g}.zip`,"https://github.com/oven-sh/bun/releases/download/");return x}async function M0(t){for(let e of(0,Ha.readdirSync)(t,{withFileTypes:!0})){let{name:a}=e,i=(0,An.join)(t,a);if(e.isFile()){if(a==="bun"||a==="bun.exe")return i;if(/^bun.*\.zip/.test(a)){let r=await(0,lo.extractZip)(i);return M0(r)}}if(/^bun/.test(a)&&e.isDirectory())return M0(i)}throw new Error("Could not find executable: bun")}async function sx(t){let e=await(0,z0.getExecOutput)(t,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let a=await(0,z0.getExecOutput)(t,["--version"],{ignoreReturnCode:!0});if(a.exitCode===0&&/^\d+\.\d+\.\d+/.test(a.stdout))return a.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,ox.tmpdir)());nx({version:(0,Nt.getInput)("bun-version")||ex((0,Nt.getInput)("bun-version-file"))||void 0,customUrl:(0,Nt.getInput)("bun-download-url")||void 0,registryUrl:(0,Nt.getInput)("registry-url")||void 0,scope:(0,Nt.getInput)("scope")||void 0,noCache:(0,Nt.getBooleanInput)("no-cache")||!1,token:(0,Nt.getInput)("token")}).then(({version:t,revision:e,bunPath:a,url:i,cacheHit:r})=>{(0,Nt.setOutput)("bun-version",t),(0,Nt.setOutput)("bun-revision",e),(0,Nt.setOutput)("bun-path",a),(0,Nt.setOutput)("bun-download-url",i),(0,Nt.setOutput)("cache-hit",r),process.exit(0)}).catch(t=>{(0,Nt.setFailed)(t),process.exit(1)}); +${a}`);return a}function Yv(t,e){return t.endsWith(e)?t:((0,Bn.renameSync)(t,t+e),t+e)}function Zv(){let t=process.platform;return t==="win32"?"windows":t}function Jv(){let t=process.arch;return t==="arm64"?"aarch64":t}var kz={"package.json":t=>JSON.parse(t).packageManager?.split("bun@")?.[1],".tool-versions":t=>t.match(/^bun\s?(?.*?)$/m)?.groups?.version,".bumrc":t=>t,".bun-version":t=>t};function ex(t){let e=process.env.GITHUB_WORKSPACE;if(!e||!t)return;(0,In.debug)(`Reading version from ${t}`);let a=(0,ml.join)(e,t),i=(0,ml.basename)(t);if(!(0,Bn.existsSync)(a)){(0,In.warning)(`File ${a} not found`);return}let r=kz[i]??(()=>{}),n;try{if(n=r((0,Bn.readFileSync)(a,"utf8"))?.trim(),!n){(0,In.warning)(`Failed to read version from ${t}`);return}}catch(s){let{message:o}=s;(0,In.warning)(`Failed to read ${t}: ${o}`)}finally{if(n)return(0,Kv.info)(`Obtained version ${n} from ${t}`),n}}var Sr=Ct(ax()),nx=async t=>{let e=(0,An.join)(process.cwd(),"bunfig.toml");Wv(e,t);let a=await Fz(t),i=Uz(t),r=(0,An.join)((0,ix.homedir)(),".bun","bin");try{(0,Ha.mkdirSync)(r,{recursive:!0})}catch(c){if(c.code!=="EEXIST")throw c}(0,_r.addPath)(r);let n=c=>process.platform==="win32"?`${c}.exe`:c,s=(0,An.join)(r,n("bun"));try{(0,Ha.symlinkSync)(s,(0,An.join)(r,n("bunx")))}catch(c){if(c.code!=="EEXIST")throw c}let o,p=!1;if(i&&await(0,fl.restoreCache)([s],a)&&(o=await sx(s),o?(p=!0,(0,_r.info)(`Using a cached version of Bun: ${o}`)):(0,_r.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),p||((0,_r.info)(`Downloading a new version of Bun: ${a}`),o=await Hz(a,s)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[d]=o.split("+");return(0,rx.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:p,bunPath:s,url:a})),{version:d,revision:o,bunPath:s,url:a,cacheHit:p}};async function Hz(t,e){let a=Yv(await(0,lo.downloadTool)(t),".zip"),i=await(0,lo.extractZip)(a),r=await M0(i);try{(0,Ha.renameSync)(r,e)}catch{(0,Ha.copyFileSync)(r,e)}return await sx(e)}function Uz(t){let{customUrl:e,version:a,noCache:i}=t;return i||e||!a||/latest|canary|action/i.test(a)?!1:(0,fl.isFeatureAvailable)()}async function Fz(t){let{customUrl:e}=t;if(e)return e;let i=(await(await Qv("https://api.github.com/repos/oven-sh/bun/git/refs/tags",{headers:{Authorization:`Bearer ${t.token}`}})).json()).filter(N=>N.ref.startsWith("refs/tags/bun-v")||N.ref==="refs/tags/canary").map(N=>N.ref.replace(/refs\/tags\/(bun-v)?/g,"")),{version:r,os:n,arch:s,avx2:o,profile:p}=t,d=i.find(N=>N===r);d?(0,Sr.validate)(d)&&(d=`bun-v${d}`):(i=i.filter(N=>(0,Sr.validate)(N)).sort(Sr.compareVersions),r==="latest"?d=`bun-v${i.at(-1)}`:d=`bun-v${i.filter(N=>(0,Sr.satisfies)(N,r)).at(-1)}`);let l=encodeURIComponent(d??r),c=encodeURIComponent(n??Zv()),m=encodeURIComponent(s??Jv()),u=encodeURIComponent(o?"-baseline":""),g=encodeURIComponent(p?"-profile":""),{href:x}=new URL(`${l}/bun-${c}-${m}${u}${g}.zip`,"https://github.com/oven-sh/bun/releases/download/");return x}async function M0(t){for(let e of(0,Ha.readdirSync)(t,{withFileTypes:!0})){let{name:a}=e,i=(0,An.join)(t,a);if(e.isFile()){if(a==="bun"||a==="bun.exe")return i;if(/^bun.*\.zip/.test(a)){let r=await(0,lo.extractZip)(i);return M0(r)}}if(/^bun/.test(a)&&e.isDirectory())return M0(i)}throw new Error("Could not find executable: bun")}async function sx(t){let e=await(0,z0.getExecOutput)(t,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let a=await(0,z0.getExecOutput)(t,["--version"],{ignoreReturnCode:!0});if(a.exitCode===0&&/^\d+\.\d+\.\d+/.test(a.stdout))return a.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,ox.tmpdir)());nx({version:(0,Nt.getInput)("bun-version")||ex((0,Nt.getInput)("bun-version-file"))||void 0,customUrl:(0,Nt.getInput)("bun-download-url")||void 0,registryUrl:(0,Nt.getInput)("registry-url")||void 0,scope:(0,Nt.getInput)("scope")||void 0,noCache:(0,Nt.getBooleanInput)("no-cache")||!1,token:(0,Nt.getInput)("token")}).then(({version:t,revision:e,bunPath:a,url:i,cacheHit:r})=>{(0,Nt.setOutput)("bun-version",t),(0,Nt.setOutput)("bun-revision",e),(0,Nt.setOutput)("bun-path",a),(0,Nt.setOutput)("bun-download-url",i),(0,Nt.setOutput)("cache-hit",r),process.exit(0)}).catch(t=>{(0,Nt.setFailed)(t),process.exit(1)}); /*! Bundled license information: sax/lib/sax.js: