diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 718572b..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 99a06b1..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Release - -on: - release: - types: [published, edited] - -jobs: - release: - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.release.tag_name }} - - - uses: pnpm/action-setup@v2 - - uses: actions/setup-node@v4 - with: - cache: pnpm - cache-dependency-path: pnpm-lock.yaml - - - name: Build - run: pnpm install && pnpm build - - - uses: JasonEtco/build-and-tag-action@v2 - env: - GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 397eee7..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "Test" - -on: - push: - branches: ["main"] - workflow_call: - workflow_dispatch: - -jobs: - test-cache: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v2 - - uses: actions/setup-node@v4 - with: - cache: pnpm - cache-dependency-path: pnpm-lock.yaml - - - name: Build - run: pnpm install && pnpm build - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v7 - - - name: Setup Attic Cache - uses: ./ - with: - endpoint: ${{ secrets.ATTIC_ENDPOINT }} - cache: ${{ secrets.ATTIC_CACHE }} - token: ${{ secrets.ATTIC_TOKEN }} - - - name: Build Nix Package - run: nix-build test.nix diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5323301..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.DS_Store - -node_modules/ - -# nix -.direnv/ -.envrc -result* diff --git a/.node-version b/.node-version deleted file mode 100644 index 209e3ef..0000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 74833d3..0000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -.direnv/ -dist/ - -pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0c597d3..0000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "useTabs": true, - "printWidth": 120 -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index cc07165..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Ryan Cao - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 309095b..0000000 --- a/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# attic-action - -Cache Nix derivations with [Attic](https://github.com/zhaofengli/attic). - -## Usage - -Configure your attic instance with an endpoint, a cache, and a token that can read from and write to the cache. Then, add this step to a workflow job after Nix is installed: - -```yaml -- name: Setup Attic cache - uses: ryanccn/attic-action@v0 - with: - endpoint: ${{ secrets.ATTIC_ENDPOINT }} - cache: ${{ secrets.ATTIC_CACHE }} - token: ${{ secrets.ATTIC_TOKEN }} -``` - -## Inputs - -### `endpoint` - -The Attic endpoint. This is the URL without the cache name. - -### `cache` - -The name of the Attic cache. - -### `token` - -The authorization token to provide to Attic (**optional**). - -### `skip-push` - -Disable pushing new derivations to the cache automatically at the end of the job (**default is false**). - -This requires you to invoke `attic push ` with the paths you want to push to the cache manually. - -## Outputs - -None - -## License - -MIT diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..2df5d7b --- /dev/null +++ b/dist/index.js @@ -0,0 +1,8 @@ +"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/utils.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.toCommandProperties=exports.toCommandValue=void 0;function toCommandValue(input){return input==null?"":typeof input=="string"||input instanceof String?input:JSON.stringify(input)}exports.toCommandValue=toCommandValue;function toCommandProperties(annotationProperties){return Object.keys(annotationProperties).length?{title:annotationProperties.title,file:annotationProperties.file,line:annotationProperties.startLine,endLine:annotationProperties.endLine,col:annotationProperties.startColumn,endColumn:annotationProperties.endColumn}:{}}exports.toCommandProperties=toCommandProperties}});var require_command=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/command.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.issue=exports.issueCommand=void 0;var os=__importStar(require("os")),utils_1=require_utils();function issueCommand(command,properties,message){let cmd=new Command(command,properties,message);process.stdout.write(cmd.toString()+os.EOL)}exports.issueCommand=issueCommand;function issue(name,message=""){issueCommand(name,{},message)}exports.issue=issue;var CMD_STRING="::",Command=class{constructor(command,properties,message){command||(command="missing.command"),this.command=command,this.properties=properties,this.message=message}toString(){let cmdStr=CMD_STRING+this.command;if(this.properties&&Object.keys(this.properties).length>0){cmdStr+=" ";let first=!0;for(let key in this.properties)if(this.properties.hasOwnProperty(key)){let val=this.properties[key];val&&(first?first=!1:cmdStr+=",",cmdStr+=`${key}=${escapeProperty(val)}`)}}return cmdStr+=`${CMD_STRING}${escapeData(this.message)}`,cmdStr}};function escapeData(s){return utils_1.toCommandValue(s).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(s){return utils_1.toCommandValue(s).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}}});function rng(){return poolPtr>rnds8Pool.length-16&&(import_crypto.default.randomFillSync(rnds8Pool),poolPtr=0),rnds8Pool.slice(poolPtr,poolPtr+=16)}var import_crypto,rnds8Pool,poolPtr,init_rng=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/rng.js"(){import_crypto=__toESM(require("crypto")),rnds8Pool=new Uint8Array(256),poolPtr=rnds8Pool.length}});var regex_default,init_regex=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/regex.js"(){regex_default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}});function validate(uuid){return typeof uuid=="string"&®ex_default.test(uuid)}var validate_default,init_validate=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/validate.js"(){init_regex();validate_default=validate}});function stringify(arr,offset=0){let uuid=(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase();if(!validate_default(uuid))throw TypeError("Stringified UUID is invalid");return uuid}var byteToHex,stringify_default,init_stringify=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/stringify.js"(){init_validate();byteToHex=[];for(let i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));stringify_default=stringify}});function v1(options,buf,offset){let i=buf&&offset||0,b=buf||new Array(16);options=options||{};let node=options.node||_nodeId,clockseq=options.clockseq!==void 0?options.clockseq:_clockseq;if(node==null||clockseq==null){let seedBytes=options.random||(options.rng||rng)();node==null&&(node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]),clockseq==null&&(clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383)}let msecs=options.msecs!==void 0?options.msecs:Date.now(),nsecs=options.nsecs!==void 0?options.nsecs:_lastNSecs+1,dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===void 0&&(clockseq=clockseq+1&16383),(dt<0||msecs>_lastMSecs)&&options.nsecs===void 0&&(nsecs=0),nsecs>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=msecs,_lastNSecs=nsecs,_clockseq=clockseq,msecs+=122192928e5;let tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255,b[i++]=tl>>>16&255,b[i++]=tl>>>8&255,b[i++]=tl&255;let tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255,b[i++]=tmh&255,b[i++]=tmh>>>24&15|16,b[i++]=tmh>>>16&255,b[i++]=clockseq>>>8|128,b[i++]=clockseq&255;for(let n=0;n<6;++n)b[i+n]=node[n];return buf||stringify_default(b)}var _nodeId,_clockseq,_lastMSecs,_lastNSecs,v1_default,init_v1=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v1.js"(){init_rng();init_stringify();_lastMSecs=0,_lastNSecs=0;v1_default=v1}});function parse(uuid){if(!validate_default(uuid))throw TypeError("Invalid UUID");let v,arr=new Uint8Array(16);return arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24,arr[1]=v>>>16&255,arr[2]=v>>>8&255,arr[3]=v&255,arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8,arr[5]=v&255,arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8,arr[7]=v&255,arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8,arr[9]=v&255,arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255,arr[11]=v/4294967296&255,arr[12]=v>>>24&255,arr[13]=v>>>16&255,arr[14]=v>>>8&255,arr[15]=v&255,arr}var parse_default,init_parse=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/parse.js"(){init_validate();parse_default=parse}});function stringToBytes(str){str=unescape(encodeURIComponent(str));let bytes=[];for(let i=0;inil_default,parse:()=>parse_default,stringify:()=>stringify_default,v1:()=>v1_default,v3:()=>v3_default,v4:()=>v4_default,v5:()=>v5_default,validate:()=>validate_default,version:()=>version_default});var init_esm_node=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/index.js"(){init_v1();init_v3();init_v4();init_v5();init_nil();init_version();init_validate();init_stringify();init_parse()}});var require_file_command=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/file-command.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.prepareKeyValueMessage=exports.issueFileCommand=void 0;var fs=__importStar(require("fs")),os=__importStar(require("os")),uuid_1=(init_esm_node(),__toCommonJS(esm_node_exports)),utils_1=require_utils();function issueFileCommand(command,message){let filePath=process.env[`GITHUB_${command}`];if(!filePath)throw new Error(`Unable to find environment variable for file command ${command}`);if(!fs.existsSync(filePath))throw new Error(`Missing file at path: ${filePath}`);fs.appendFileSync(filePath,`${utils_1.toCommandValue(message)}${os.EOL}`,{encoding:"utf8"})}exports.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(key,value){let delimiter=`ghadelimiter_${uuid_1.v4()}`,convertedValue=utils_1.toCommandValue(value);if(key.includes(delimiter))throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);if(convertedValue.includes(delimiter))throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);return`${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`}exports.prepareKeyValueMessage=prepareKeyValueMessage}});var require_proxy=__commonJS({"node_modules/.pnpm/@actions+http-client@2.1.0/node_modules/@actions/http-client/lib/proxy.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.checkBypass=exports.getProxyUrl=void 0;function getProxyUrl(reqUrl){let usingSsl=reqUrl.protocol==="https:";if(checkBypass(reqUrl))return;let proxyVar=(()=>usingSsl?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(proxyVar)return new URL(proxyVar)}exports.getProxyUrl=getProxyUrl;function checkBypass(reqUrl){if(!reqUrl.hostname)return!1;let reqHost=reqUrl.hostname;if(isLoopbackAddress(reqHost))return!0;let noProxy=process.env.no_proxy||process.env.NO_PROXY||"";if(!noProxy)return!1;let reqPort;reqUrl.port?reqPort=Number(reqUrl.port):reqUrl.protocol==="http:"?reqPort=80:reqUrl.protocol==="https:"&&(reqPort=443);let upperReqHosts=[reqUrl.hostname.toUpperCase()];typeof reqPort=="number"&&upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);for(let upperNoProxyItem of noProxy.split(",").map(x=>x.trim().toUpperCase()).filter(x=>x))if(upperNoProxyItem==="*"||upperReqHosts.some(x=>x===upperNoProxyItem||x.endsWith(`.${upperNoProxyItem}`)||upperNoProxyItem.startsWith(".")&&x.endsWith(`${upperNoProxyItem}`)))return!0;return!1}exports.checkBypass=checkBypass;function isLoopbackAddress(host){let hostLower=host.toLowerCase();return hostLower==="localhost"||hostLower.startsWith("127.")||hostLower.startsWith("[::1]")||hostLower.startsWith("[0:0:0:0:0:0:0:1]")}}});var require_tunnel=__commonJS({"node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js"(exports){"use strict";var net=require("net"),tls=require("tls"),http=require("http"),https=require("https"),events=require("events"),assert=require("assert"),util=require("util");exports.httpOverHttp=httpOverHttp;exports.httpsOverHttp=httpsOverHttp;exports.httpOverHttps=httpOverHttps;exports.httpsOverHttps=httpsOverHttps;function httpOverHttp(options){var agent=new TunnelingAgent(options);return agent.request=http.request,agent}function httpsOverHttp(options){var agent=new TunnelingAgent(options);return agent.request=http.request,agent.createSocket=createSecureSocket,agent.defaultPort=443,agent}function httpOverHttps(options){var agent=new TunnelingAgent(options);return agent.request=https.request,agent}function httpsOverHttps(options){var agent=new TunnelingAgent(options);return agent.request=https.request,agent.createSocket=createSecureSocket,agent.defaultPort=443,agent}function TunnelingAgent(options){var self=this;self.options=options||{},self.proxyOptions=self.options.proxy||{},self.maxSockets=self.options.maxSockets||http.Agent.defaultMaxSockets,self.requests=[],self.sockets=[],self.on("free",function(socket,host,port,localAddress){for(var options2=toOptions(host,port,localAddress),i=0,len=self.requests.length;i=this.maxSockets){self.requests.push(options);return}self.createSocket(options,function(socket){socket.on("free",onFree),socket.on("close",onCloseOrRemove),socket.on("agentRemove",onCloseOrRemove),req.onSocket(socket);function onFree(){self.emit("free",socket,options)}function onCloseOrRemove(err){self.removeSocket(socket),socket.removeListener("free",onFree),socket.removeListener("close",onCloseOrRemove),socket.removeListener("agentRemove",onCloseOrRemove)}})};TunnelingAgent.prototype.createSocket=function(options,cb){var self=this,placeholder={};self.sockets.push(placeholder);var connectOptions=mergeOptions({},self.proxyOptions,{method:"CONNECT",path:options.host+":"+options.port,agent:!1,headers:{host:options.host+":"+options.port}});options.localAddress&&(connectOptions.localAddress=options.localAddress),connectOptions.proxyAuth&&(connectOptions.headers=connectOptions.headers||{},connectOptions.headers["Proxy-Authorization"]="Basic "+new Buffer(connectOptions.proxyAuth).toString("base64")),debug("making CONNECT request");var connectReq=self.request(connectOptions);connectReq.useChunkedEncodingByDefault=!1,connectReq.once("response",onResponse),connectReq.once("upgrade",onUpgrade),connectReq.once("connect",onConnect),connectReq.once("error",onError),connectReq.end();function onResponse(res){res.upgrade=!0}function onUpgrade(res,socket,head){process.nextTick(function(){onConnect(res,socket,head)})}function onConnect(res,socket,head){if(connectReq.removeAllListeners(),socket.removeAllListeners(),res.statusCode!==200){debug("tunneling socket could not be established, statusCode=%d",res.statusCode),socket.destroy();var error=new Error("tunneling socket could not be established, statusCode="+res.statusCode);error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder);return}if(head.length>0){debug("got illegal response body from proxy"),socket.destroy();var error=new Error("got illegal response body from proxy");error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder);return}return debug("tunneling connection has established"),self.sockets[self.sockets.indexOf(placeholder)]=socket,cb(socket)}function onError(cause){connectReq.removeAllListeners(),debug(`tunneling socket could not be established, cause=%s +`,cause.message,cause.stack);var error=new Error("tunneling socket could not be established, cause="+cause.message);error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder)}};TunnelingAgent.prototype.removeSocket=function(socket){var pos=this.sockets.indexOf(socket);if(pos!==-1){this.sockets.splice(pos,1);var pending=this.requests.shift();pending&&this.createSocket(pending,function(socket2){pending.request.onSocket(socket2)})}};function createSecureSocket(options,cb){var self=this;TunnelingAgent.prototype.createSocket.call(self,options,function(socket){var hostHeader=options.request.getHeader("host"),tlsOptions=mergeOptions({},self.options,{socket,servername:hostHeader?hostHeader.replace(/:.*$/,""):options.host}),secureSocket=tls.connect(0,tlsOptions);self.sockets[self.sockets.indexOf(socket)]=secureSocket,cb(secureSocket)})}function toOptions(host,port,localAddress){return typeof host=="string"?{host,port,localAddress}:host}function mergeOptions(target){for(var i=1,len=arguments.length;i__awaiter(this,void 0,void 0,function*(){let output=Buffer.alloc(0);this.message.on("data",chunk=>{output=Buffer.concat([output,chunk])}),this.message.on("end",()=>{resolve(output.toString())})}))})}};exports.HttpClientResponse=HttpClientResponse;function isHttps(requestUrl){return new URL(requestUrl).protocol==="https:"}exports.isHttps=isHttps;var HttpClient=class{constructor(userAgent,handlers,requestOptions){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=userAgent,this.handlers=handlers||[],this.requestOptions=requestOptions,requestOptions&&(requestOptions.ignoreSslError!=null&&(this._ignoreSslError=requestOptions.ignoreSslError),this._socketTimeout=requestOptions.socketTimeout,requestOptions.allowRedirects!=null&&(this._allowRedirects=requestOptions.allowRedirects),requestOptions.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=requestOptions.allowRedirectDowngrade),requestOptions.maxRedirects!=null&&(this._maxRedirects=Math.max(requestOptions.maxRedirects,0)),requestOptions.keepAlive!=null&&(this._keepAlive=requestOptions.keepAlive),requestOptions.allowRetries!=null&&(this._allowRetries=requestOptions.allowRetries),requestOptions.maxRetries!=null&&(this._maxRetries=requestOptions.maxRetries))}options(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("OPTIONS",requestUrl,null,additionalHeaders||{})})}get(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("GET",requestUrl,null,additionalHeaders||{})})}del(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("DELETE",requestUrl,null,additionalHeaders||{})})}post(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("POST",requestUrl,data,additionalHeaders||{})})}patch(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("PATCH",requestUrl,data,additionalHeaders||{})})}put(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("PUT",requestUrl,data,additionalHeaders||{})})}head(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("HEAD",requestUrl,null,additionalHeaders||{})})}sendStream(verb,requestUrl,stream,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request(verb,requestUrl,stream,additionalHeaders)})}getJson(requestUrl,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson);let res=yield this.get(requestUrl,additionalHeaders);return this._processResponse(res,this.requestOptions)})}postJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.post(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}putJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.put(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}patchJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.patch(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}request(verb,requestUrl,data,headers){return __awaiter(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let parsedUrl=new URL(requestUrl),info4=this._prepareRequest(verb,parsedUrl,headers),maxTries=this._allowRetries&&RetryableHttpVerbs.includes(verb)?this._maxRetries+1:1,numTries=0,response;do{if(response=yield this.requestRaw(info4,data),response&&response.message&&response.message.statusCode===HttpCodes.Unauthorized){let authenticationHandler;for(let handler of this.handlers)if(handler.canHandleAuthentication(response)){authenticationHandler=handler;break}return authenticationHandler?authenticationHandler.handleAuthentication(this,info4,data):response}let redirectsRemaining=this._maxRedirects;for(;response.message.statusCode&&HttpRedirectCodes.includes(response.message.statusCode)&&this._allowRedirects&&redirectsRemaining>0;){let redirectUrl=response.message.headers.location;if(!redirectUrl)break;let parsedRedirectUrl=new URL(redirectUrl);if(parsedUrl.protocol==="https:"&&parsedUrl.protocol!==parsedRedirectUrl.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield response.readBody(),parsedRedirectUrl.hostname!==parsedUrl.hostname)for(let header in headers)header.toLowerCase()==="authorization"&&delete headers[header];info4=this._prepareRequest(verb,parsedRedirectUrl,headers),response=yield this.requestRaw(info4,data),redirectsRemaining--}if(!response.message.statusCode||!HttpResponseRetryCodes.includes(response.message.statusCode))return response;numTries+=1,numTries{function callbackForResult(err,res){err?reject(err):res?resolve(res):reject(new Error("Unknown error"))}this.requestRawWithCallback(info4,data,callbackForResult)})})}requestRawWithCallback(info4,data,onResult){typeof data=="string"&&(info4.options.headers||(info4.options.headers={}),info4.options.headers["Content-Length"]=Buffer.byteLength(data,"utf8"));let callbackCalled=!1;function handleResult(err,res){callbackCalled||(callbackCalled=!0,onResult(err,res))}let req=info4.httpModule.request(info4.options,msg=>{let res=new HttpClientResponse(msg);handleResult(void 0,res)}),socket;req.on("socket",sock=>{socket=sock}),req.setTimeout(this._socketTimeout||3*6e4,()=>{socket&&socket.end(),handleResult(new Error(`Request timeout: ${info4.options.path}`))}),req.on("error",function(err){handleResult(err)}),data&&typeof data=="string"&&req.write(data,"utf8"),data&&typeof data!="string"?(data.on("close",function(){req.end()}),data.pipe(req)):req.end()}getAgent(serverUrl){let parsedUrl=new URL(serverUrl);return this._getAgent(parsedUrl)}_prepareRequest(method,requestUrl,headers){let info4={};info4.parsedUrl=requestUrl;let usingSsl=info4.parsedUrl.protocol==="https:";info4.httpModule=usingSsl?https:http;let defaultPort=usingSsl?443:80;if(info4.options={},info4.options.host=info4.parsedUrl.hostname,info4.options.port=info4.parsedUrl.port?parseInt(info4.parsedUrl.port):defaultPort,info4.options.path=(info4.parsedUrl.pathname||"")+(info4.parsedUrl.search||""),info4.options.method=method,info4.options.headers=this._mergeHeaders(headers),this.userAgent!=null&&(info4.options.headers["user-agent"]=this.userAgent),info4.options.agent=this._getAgent(info4.parsedUrl),this.handlers)for(let handler of this.handlers)handler.prepareRequest(info4.options);return info4}_mergeHeaders(headers){return this.requestOptions&&this.requestOptions.headers?Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(headers||{})):lowercaseKeys(headers||{})}_getExistingOrDefaultHeader(additionalHeaders,header,_default){let clientHeader;return this.requestOptions&&this.requestOptions.headers&&(clientHeader=lowercaseKeys(this.requestOptions.headers)[header]),additionalHeaders[header]||clientHeader||_default}_getAgent(parsedUrl){let agent,proxyUrl=pm.getProxyUrl(parsedUrl),useProxy=proxyUrl&&proxyUrl.hostname;if(this._keepAlive&&useProxy&&(agent=this._proxyAgent),this._keepAlive&&!useProxy&&(agent=this._agent),agent)return agent;let usingSsl=parsedUrl.protocol==="https:",maxSockets=100;if(this.requestOptions&&(maxSockets=this.requestOptions.maxSockets||http.globalAgent.maxSockets),proxyUrl&&proxyUrl.hostname){let agentOptions={maxSockets,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(proxyUrl.username||proxyUrl.password)&&{proxyAuth:`${proxyUrl.username}:${proxyUrl.password}`}),{host:proxyUrl.hostname,port:proxyUrl.port})},tunnelAgent,overHttps=proxyUrl.protocol==="https:";usingSsl?tunnelAgent=overHttps?tunnel.httpsOverHttps:tunnel.httpsOverHttp:tunnelAgent=overHttps?tunnel.httpOverHttps:tunnel.httpOverHttp,agent=tunnelAgent(agentOptions),this._proxyAgent=agent}if(this._keepAlive&&!agent){let options={keepAlive:this._keepAlive,maxSockets};agent=usingSsl?new https.Agent(options):new http.Agent(options),this._agent=agent}return agent||(agent=usingSsl?https.globalAgent:http.globalAgent),usingSsl&&this._ignoreSslError&&(agent.options=Object.assign(agent.options||{},{rejectUnauthorized:!1})),agent}_performExponentialBackoff(retryNumber){return __awaiter(this,void 0,void 0,function*(){retryNumber=Math.min(ExponentialBackoffCeiling,retryNumber);let ms=ExponentialBackoffTimeSlice*Math.pow(2,retryNumber);return new Promise(resolve=>setTimeout(()=>resolve(),ms))})}_processResponse(res,options){return __awaiter(this,void 0,void 0,function*(){return new Promise((resolve,reject)=>__awaiter(this,void 0,void 0,function*(){let statusCode=res.message.statusCode||0,response={statusCode,result:null,headers:{}};statusCode===HttpCodes.NotFound&&resolve(response);function dateTimeDeserializer(key,value){if(typeof value=="string"){let a=new Date(value);if(!isNaN(a.valueOf()))return a}return value}let obj,contents;try{contents=yield res.readBody(),contents&&contents.length>0&&(options&&options.deserializeDates?obj=JSON.parse(contents,dateTimeDeserializer):obj=JSON.parse(contents),response.result=obj),response.headers=res.message.headers}catch{}if(statusCode>299){let msg;obj&&obj.message?msg=obj.message:contents&&contents.length>0?msg=contents:msg=`Failed request: (${statusCode})`;let err=new HttpClientError(msg,statusCode);err.result=response.result,reject(err)}else resolve(response)}))})}};exports.HttpClient=HttpClient;var lowercaseKeys=obj=>Object.keys(obj).reduce((c,k)=>(c[k.toLowerCase()]=obj[k],c),{})}});var require_auth=__commonJS({"node_modules/.pnpm/@actions+http-client@2.1.0/node_modules/@actions/http-client/lib/auth.js"(exports){"use strict";var __awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.PersonalAccessTokenCredentialHandler=exports.BearerCredentialHandler=exports.BasicCredentialHandler=void 0;var BasicCredentialHandler=class{constructor(username,password){this.username=username,this.password=password}prepareRequest(options){if(!options.headers)throw Error("The request has no headers");options.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.BasicCredentialHandler=BasicCredentialHandler;var BearerCredentialHandler=class{constructor(token){this.token=token}prepareRequest(options){if(!options.headers)throw Error("The request has no headers");options.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.BearerCredentialHandler=BearerCredentialHandler;var PersonalAccessTokenCredentialHandler=class{constructor(token){this.token=token}prepareRequest(options){if(!options.headers)throw Error("The request has no headers");options.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler}});var require_oidc_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/oidc-utils.js"(exports){"use strict";var __awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.OidcClient=void 0;var http_client_1=require_lib(),auth_1=require_auth(),core_1=require_core(),OidcClient=class _OidcClient{static createHttpClient(allowRetry=!0,maxRetry=10){let requestOptions={allowRetries:allowRetry,maxRetries:maxRetry};return new http_client_1.HttpClient("actions/oidc-client",[new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())],requestOptions)}static getRequestToken(){let token=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!token)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return token}static getIDTokenUrl(){let runtimeUrl=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!runtimeUrl)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return runtimeUrl}static getCall(id_token_url){var _a;return __awaiter(this,void 0,void 0,function*(){let id_token=(_a=(yield _OidcClient.createHttpClient().getJson(id_token_url).catch(error=>{throw new Error(`Failed to get ID Token. + + Error Code : ${error.statusCode} + + Error Message: ${error.result.message}`)})).result)===null||_a===void 0?void 0:_a.value;if(!id_token)throw new Error("Response json body do not have ID Token field");return id_token})}static getIDToken(audience){return __awaiter(this,void 0,void 0,function*(){try{let id_token_url=_OidcClient.getIDTokenUrl();if(audience){let encodedAudience=encodeURIComponent(audience);id_token_url=`${id_token_url}&audience=${encodedAudience}`}core_1.debug(`ID token url is ${id_token_url}`);let id_token=yield _OidcClient.getCall(id_token_url);return core_1.setSecret(id_token),id_token}catch(error){throw new Error(`Error message: ${error.message}`)}})}};exports.OidcClient=OidcClient}});var require_summary=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/summary.js"(exports){"use strict";var __awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.summary=exports.markdownSummary=exports.SUMMARY_DOCS_URL=exports.SUMMARY_ENV_VAR=void 0;var os_1=require("os"),fs_1=require("fs"),{access,appendFile,writeFile:writeFile2}=fs_1.promises;exports.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";exports.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var Summary=class{constructor(){this._buffer=""}filePath(){return __awaiter(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let pathFromEnv=process.env[exports.SUMMARY_ENV_VAR];if(!pathFromEnv)throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield access(pathFromEnv,fs_1.constants.R_OK|fs_1.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`)}return this._filePath=pathFromEnv,this._filePath})}wrap(tag,content,attrs={}){let htmlAttrs=Object.entries(attrs).map(([key,value])=>` ${key}="${value}"`).join("");return content?`<${tag}${htmlAttrs}>${content}`:`<${tag}${htmlAttrs}>`}write(options){return __awaiter(this,void 0,void 0,function*(){let overwrite=!!options?.overwrite,filePath=yield this.filePath();return yield(overwrite?writeFile2:appendFile)(filePath,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return __awaiter(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(text,addEOL=!1){return this._buffer+=text,addEOL?this.addEOL():this}addEOL(){return this.addRaw(os_1.EOL)}addCodeBlock(code,lang){let attrs=Object.assign({},lang&&{lang}),element=this.wrap("pre",this.wrap("code",code),attrs);return this.addRaw(element).addEOL()}addList(items,ordered=!1){let tag=ordered?"ol":"ul",listItems=items.map(item=>this.wrap("li",item)).join(""),element=this.wrap(tag,listItems);return this.addRaw(element).addEOL()}addTable(rows){let tableBody=rows.map(row=>{let cells=row.map(cell=>{if(typeof cell=="string")return this.wrap("td",cell);let{header,data,colspan,rowspan}=cell,tag=header?"th":"td",attrs=Object.assign(Object.assign({},colspan&&{colspan}),rowspan&&{rowspan});return this.wrap(tag,data,attrs)}).join("");return this.wrap("tr",cells)}).join(""),element=this.wrap("table",tableBody);return this.addRaw(element).addEOL()}addDetails(label,content){let element=this.wrap("details",this.wrap("summary",label)+content);return this.addRaw(element).addEOL()}addImage(src,alt,options){let{width,height}=options||{},attrs=Object.assign(Object.assign({},width&&{width}),height&&{height}),element=this.wrap("img",null,Object.assign({src,alt},attrs));return this.addRaw(element).addEOL()}addHeading(text,level){let tag=`h${level}`,allowedTag=["h1","h2","h3","h4","h5","h6"].includes(tag)?tag:"h1",element=this.wrap(allowedTag,text);return this.addRaw(element).addEOL()}addSeparator(){let element=this.wrap("hr",null);return this.addRaw(element).addEOL()}addBreak(){let element=this.wrap("br",null);return this.addRaw(element).addEOL()}addQuote(text,cite){let attrs=Object.assign({},cite&&{cite}),element=this.wrap("blockquote",text,attrs);return this.addRaw(element).addEOL()}addLink(text,href){let element=this.wrap("a",text,{href});return this.addRaw(element).addEOL()}},_summary=new Summary;exports.markdownSummary=_summary;exports.summary=_summary}});var require_path_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/path-utils.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.toPlatformPath=exports.toWin32Path=exports.toPosixPath=void 0;var path=__importStar(require("path"));function toPosixPath(pth){return pth.replace(/[\\]/g,"/")}exports.toPosixPath=toPosixPath;function toWin32Path(pth){return pth.replace(/[/]/g,"\\")}exports.toWin32Path=toWin32Path;function toPlatformPath(pth){return pth.replace(/[/\\]/g,path.sep)}exports.toPlatformPath=toPlatformPath}});var require_core=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/core.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.getIDToken=exports.getState=exports.saveState=exports.group=exports.endGroup=exports.startGroup=exports.info=exports.notice=exports.warning=exports.error=exports.debug=exports.isDebug=exports.setFailed=exports.setCommandEcho=exports.setOutput=exports.getBooleanInput=exports.getMultilineInput=exports.getInput=exports.addPath=exports.setSecret=exports.exportVariable=exports.ExitCode=void 0;var command_1=require_command(),file_command_1=require_file_command(),utils_1=require_utils(),os=__importStar(require("os")),path=__importStar(require("path")),oidc_utils_1=require_oidc_utils(),ExitCode;(function(ExitCode2){ExitCode2[ExitCode2.Success=0]="Success",ExitCode2[ExitCode2.Failure=1]="Failure"})(ExitCode=exports.ExitCode||(exports.ExitCode={}));function exportVariable(name,val){let convertedVal=utils_1.toCommandValue(val);if(process.env[name]=convertedVal,process.env.GITHUB_ENV||"")return file_command_1.issueFileCommand("ENV",file_command_1.prepareKeyValueMessage(name,val));command_1.issueCommand("set-env",{name},convertedVal)}exports.exportVariable=exportVariable;function setSecret(secret){command_1.issueCommand("add-mask",{},secret)}exports.setSecret=setSecret;function addPath(inputPath){process.env.GITHUB_PATH||""?file_command_1.issueFileCommand("PATH",inputPath):command_1.issueCommand("add-path",{},inputPath),process.env.PATH=`${inputPath}${path.delimiter}${process.env.PATH}`}exports.addPath=addPath;function getInput3(name,options){let val=process.env[`INPUT_${name.replace(/ /g,"_").toUpperCase()}`]||"";if(options&&options.required&&!val)throw new Error(`Input required and not supplied: ${name}`);return options&&options.trimWhitespace===!1?val:val.trim()}exports.getInput=getInput3;function getMultilineInput(name,options){let inputs=getInput3(name,options).split(` +`).filter(x=>x!=="");return options&&options.trimWhitespace===!1?inputs:inputs.map(input=>input.trim())}exports.getMultilineInput=getMultilineInput;function getBooleanInput(name,options){let trueValue=["true","True","TRUE"],falseValue=["false","False","FALSE"],val=getInput3(name,options);if(trueValue.includes(val))return!0;if(falseValue.includes(val))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}exports.getBooleanInput=getBooleanInput;function setOutput(name,value){if(process.env.GITHUB_OUTPUT||"")return file_command_1.issueFileCommand("OUTPUT",file_command_1.prepareKeyValueMessage(name,value));process.stdout.write(os.EOL),command_1.issueCommand("set-output",{name},utils_1.toCommandValue(value))}exports.setOutput=setOutput;function setCommandEcho(enabled){command_1.issue("echo",enabled?"on":"off")}exports.setCommandEcho=setCommandEcho;function setFailed3(message){process.exitCode=ExitCode.Failure,error(message)}exports.setFailed=setFailed3;function isDebug(){return process.env.RUNNER_DEBUG==="1"}exports.isDebug=isDebug;function debug(message){command_1.issueCommand("debug",{},message)}exports.debug=debug;function error(message,properties={}){command_1.issueCommand("error",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.error=error;function warning2(message,properties={}){command_1.issueCommand("warning",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.warning=warning2;function notice(message,properties={}){command_1.issueCommand("notice",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.notice=notice;function info4(message){process.stdout.write(message+os.EOL)}exports.info=info4;function startGroup4(name){command_1.issue("group",name)}exports.startGroup=startGroup4;function endGroup4(){command_1.issue("endgroup")}exports.endGroup=endGroup4;function group(name,fn){return __awaiter(this,void 0,void 0,function*(){startGroup4(name);let result;try{result=yield fn()}finally{endGroup4()}return result})}exports.group=group;function saveState2(name,value){if(process.env.GITHUB_STATE||"")return file_command_1.issueFileCommand("STATE",file_command_1.prepareKeyValueMessage(name,value));command_1.issueCommand("save-state",{name},utils_1.toCommandValue(value))}exports.saveState=saveState2;function getState2(name){return process.env[`STATE_${name}`]||""}exports.getState=getState2;function getIDToken(aud){return __awaiter(this,void 0,void 0,function*(){return yield oidc_utils_1.OidcClient.getIDToken(aud)})}exports.getIDToken=getIDToken;var summary_1=require_summary();Object.defineProperty(exports,"summary",{enumerable:!0,get:function(){return summary_1.summary}});var summary_2=require_summary();Object.defineProperty(exports,"markdownSummary",{enumerable:!0,get:function(){return summary_2.markdownSummary}});var path_utils_1=require_path_utils();Object.defineProperty(exports,"toPosixPath",{enumerable:!0,get:function(){return path_utils_1.toPosixPath}});Object.defineProperty(exports,"toWin32Path",{enumerable:!0,get:function(){return path_utils_1.toWin32Path}});Object.defineProperty(exports,"toPlatformPath",{enumerable:!0,get:function(){return path_utils_1.toPlatformPath}})}});var require_io_util=__commonJS({"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io-util.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},_a;Object.defineProperty(exports,"__esModule",{value:!0});exports.getCmdPath=exports.tryGetExecutablePath=exports.isRooted=exports.isDirectory=exports.exists=exports.READONLY=exports.UV_FS_O_EXLOCK=exports.IS_WINDOWS=exports.unlink=exports.symlink=exports.stat=exports.rmdir=exports.rm=exports.rename=exports.readlink=exports.readdir=exports.open=exports.mkdir=exports.lstat=exports.copyFile=exports.chmod=void 0;var fs=__importStar(require("fs")),path=__importStar(require("path"));_a=fs.promises,exports.chmod=_a.chmod,exports.copyFile=_a.copyFile,exports.lstat=_a.lstat,exports.mkdir=_a.mkdir,exports.open=_a.open,exports.readdir=_a.readdir,exports.readlink=_a.readlink,exports.rename=_a.rename,exports.rm=_a.rm,exports.rmdir=_a.rmdir,exports.stat=_a.stat,exports.symlink=_a.symlink,exports.unlink=_a.unlink;exports.IS_WINDOWS=process.platform==="win32";exports.UV_FS_O_EXLOCK=268435456;exports.READONLY=fs.constants.O_RDONLY;function exists(fsPath){return __awaiter(this,void 0,void 0,function*(){try{yield exports.stat(fsPath)}catch(err){if(err.code==="ENOENT")return!1;throw err}return!0})}exports.exists=exists;function isDirectory(fsPath,useStat=!1){return __awaiter(this,void 0,void 0,function*(){return(useStat?yield exports.stat(fsPath):yield exports.lstat(fsPath)).isDirectory()})}exports.isDirectory=isDirectory;function isRooted(p){if(p=normalizeSeparators(p),!p)throw new Error('isRooted() parameter "p" cannot be empty');return exports.IS_WINDOWS?p.startsWith("\\")||/^[A-Z]:/i.test(p):p.startsWith("/")}exports.isRooted=isRooted;function tryGetExecutablePath(filePath,extensions){return __awaiter(this,void 0,void 0,function*(){let stats;try{stats=yield exports.stat(filePath)}catch(err){err.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`)}if(stats&&stats.isFile()){if(exports.IS_WINDOWS){let upperExt=path.extname(filePath).toUpperCase();if(extensions.some(validExt=>validExt.toUpperCase()===upperExt))return filePath}else if(isUnixExecutable(stats))return filePath}let originalFilePath=filePath;for(let extension of extensions){filePath=originalFilePath+extension,stats=void 0;try{stats=yield exports.stat(filePath)}catch(err){err.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`)}if(stats&&stats.isFile()){if(exports.IS_WINDOWS){try{let directory=path.dirname(filePath),upperName=path.basename(filePath).toUpperCase();for(let actualName of yield exports.readdir(directory))if(upperName===actualName.toUpperCase()){filePath=path.join(directory,actualName);break}}catch(err){console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`)}return filePath}else if(isUnixExecutable(stats))return filePath}}return""})}exports.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(p){return p=p||"",exports.IS_WINDOWS?(p=p.replace(/\//g,"\\"),p.replace(/\\\\+/g,"\\")):p.replace(/\/\/+/g,"/")}function isUnixExecutable(stats){return(stats.mode&1)>0||(stats.mode&8)>0&&stats.gid===process.getgid()||(stats.mode&64)>0&&stats.uid===process.getuid()}function getCmdPath(){var _a2;return(_a2=process.env.COMSPEC)!==null&&_a2!==void 0?_a2:"cmd.exe"}exports.getCmdPath=getCmdPath}});var require_io=__commonJS({"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.findInPath=exports.which=exports.mkdirP=exports.rmRF=exports.mv=exports.cp=void 0;var assert_1=require("assert"),path=__importStar(require("path")),ioUtil=__importStar(require_io_util());function cp(source,dest,options={}){return __awaiter(this,void 0,void 0,function*(){let{force,recursive,copySourceDirectory}=readCopyOptions(options),destStat=(yield ioUtil.exists(dest))?yield ioUtil.stat(dest):null;if(destStat&&destStat.isFile()&&!force)return;let newDest=destStat&&destStat.isDirectory()&©SourceDirectory?path.join(dest,path.basename(source)):dest;if(!(yield ioUtil.exists(source)))throw new Error(`no such file or directory: ${source}`);if((yield ioUtil.stat(source)).isDirectory())if(recursive)yield cpDirRecursive(source,newDest,0,force);else throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);else{if(path.relative(source,newDest)==="")throw new Error(`'${newDest}' and '${source}' are the same file`);yield copyFile(source,newDest,force)}})}exports.cp=cp;function mv(source,dest,options={}){return __awaiter(this,void 0,void 0,function*(){if(yield ioUtil.exists(dest)){let destExists=!0;if((yield ioUtil.isDirectory(dest))&&(dest=path.join(dest,path.basename(source)),destExists=yield ioUtil.exists(dest)),destExists)if(options.force==null||options.force)yield rmRF(dest);else throw new Error("Destination already exists")}yield mkdirP(path.dirname(dest)),yield ioUtil.rename(source,dest)})}exports.mv=mv;function rmRF(inputPath){return __awaiter(this,void 0,void 0,function*(){if(ioUtil.IS_WINDOWS&&/[*"<>|]/.test(inputPath))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield ioUtil.rm(inputPath,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(err){throw new Error(`File was unable to be removed ${err}`)}})}exports.rmRF=rmRF;function mkdirP(fsPath){return __awaiter(this,void 0,void 0,function*(){assert_1.ok(fsPath,"a path argument must be provided"),yield ioUtil.mkdir(fsPath,{recursive:!0})})}exports.mkdirP=mkdirP;function which(tool,check){return __awaiter(this,void 0,void 0,function*(){if(!tool)throw new Error("parameter 'tool' is required");if(check){let result=yield which(tool,!1);if(!result)throw ioUtil.IS_WINDOWS?new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`):new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return result}let matches=yield findInPath(tool);return matches&&matches.length>0?matches[0]:""})}exports.which=which;function findInPath(tool){return __awaiter(this,void 0,void 0,function*(){if(!tool)throw new Error("parameter 'tool' is required");let extensions=[];if(ioUtil.IS_WINDOWS&&process.env.PATHEXT)for(let extension of process.env.PATHEXT.split(path.delimiter))extension&&extensions.push(extension);if(ioUtil.isRooted(tool)){let filePath=yield ioUtil.tryGetExecutablePath(tool,extensions);return filePath?[filePath]:[]}if(tool.includes(path.sep))return[];let directories=[];if(process.env.PATH)for(let p of process.env.PATH.split(path.delimiter))p&&directories.push(p);let matches=[];for(let directory of directories){let filePath=yield ioUtil.tryGetExecutablePath(path.join(directory,tool),extensions);filePath&&matches.push(filePath)}return matches})}exports.findInPath=findInPath;function readCopyOptions(options){let force=options.force==null?!0:options.force,recursive=!!options.recursive,copySourceDirectory=options.copySourceDirectory==null?!0:!!options.copySourceDirectory;return{force,recursive,copySourceDirectory}}function cpDirRecursive(sourceDir,destDir,currentDepth,force){return __awaiter(this,void 0,void 0,function*(){if(currentDepth>=255)return;currentDepth++,yield mkdirP(destDir);let files=yield ioUtil.readdir(sourceDir);for(let fileName of files){let srcFile=`${sourceDir}/${fileName}`,destFile=`${destDir}/${fileName}`;(yield ioUtil.lstat(srcFile)).isDirectory()?yield cpDirRecursive(srcFile,destFile,currentDepth,force):yield copyFile(srcFile,destFile,force)}yield ioUtil.chmod(destDir,(yield ioUtil.stat(sourceDir)).mode)})}function copyFile(srcFile,destFile,force){return __awaiter(this,void 0,void 0,function*(){if((yield ioUtil.lstat(srcFile)).isSymbolicLink()){try{yield ioUtil.lstat(destFile),yield ioUtil.unlink(destFile)}catch(e){e.code==="EPERM"&&(yield ioUtil.chmod(destFile,"0666"),yield ioUtil.unlink(destFile))}let symlinkFull=yield ioUtil.readlink(srcFile);yield ioUtil.symlink(symlinkFull,destFile,ioUtil.IS_WINDOWS?"junction":null)}else(!(yield ioUtil.exists(destFile))||force)&&(yield ioUtil.copyFile(srcFile,destFile))})}}});var require_toolrunner=__commonJS({"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/toolrunner.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.argStringToArray=exports.ToolRunner=void 0;var os=__importStar(require("os")),events=__importStar(require("events")),child=__importStar(require("child_process")),path=__importStar(require("path")),io=__importStar(require_io()),ioUtil=__importStar(require_io_util()),timers_1=require("timers"),IS_WINDOWS=process.platform==="win32",ToolRunner=class extends events.EventEmitter{constructor(toolPath,args,options){if(super(),!toolPath)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=toolPath,this.args=args||[],this.options=options||{}}_debug(message){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(message)}_getCommandString(options,noPrefix){let toolPath=this._getSpawnFileName(),args=this._getSpawnArgs(options),cmd=noPrefix?"":"[command]";if(IS_WINDOWS)if(this._isCmdFile()){cmd+=toolPath;for(let a of args)cmd+=` ${a}`}else if(options.windowsVerbatimArguments){cmd+=`"${toolPath}"`;for(let a of args)cmd+=` ${a}`}else{cmd+=this._windowsQuoteCmdArg(toolPath);for(let a of args)cmd+=` ${this._windowsQuoteCmdArg(a)}`}else{cmd+=toolPath;for(let a of args)cmd+=` ${a}`}return cmd}_processLineBuffer(data,strBuffer,onLine){try{let s=strBuffer+data.toString(),n=s.indexOf(os.EOL);for(;n>-1;){let line=s.substring(0,n);onLine(line),s=s.substring(n+os.EOL.length),n=s.indexOf(os.EOL)}return s}catch(err){return this._debug(`error processing line. Failed with error ${err}`),""}}_getSpawnFileName(){return IS_WINDOWS&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(options){if(IS_WINDOWS&&this._isCmdFile()){let argline=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let a of this.args)argline+=" ",argline+=options.windowsVerbatimArguments?a:this._windowsQuoteCmdArg(a);return argline+='"',[argline]}return this.args}_endsWith(str,end){return str.endsWith(end)}_isCmdFile(){let upperToolPath=this.toolPath.toUpperCase();return this._endsWith(upperToolPath,".CMD")||this._endsWith(upperToolPath,".BAT")}_windowsQuoteCmdArg(arg){if(!this._isCmdFile())return this._uvQuoteCmdArg(arg);if(!arg)return'""';let cmdSpecialChars=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],needsQuotes=!1;for(let char of arg)if(cmdSpecialChars.some(x=>x===char)){needsQuotes=!0;break}if(!needsQuotes)return arg;let reverse='"',quoteHit=!0;for(let i=arg.length;i>0;i--)reverse+=arg[i-1],quoteHit&&arg[i-1]==="\\"?reverse+="\\":arg[i-1]==='"'?(quoteHit=!0,reverse+='"'):quoteHit=!1;return reverse+='"',reverse.split("").reverse().join("")}_uvQuoteCmdArg(arg){if(!arg)return'""';if(!arg.includes(" ")&&!arg.includes(" ")&&!arg.includes('"'))return arg;if(!arg.includes('"')&&!arg.includes("\\"))return`"${arg}"`;let reverse='"',quoteHit=!0;for(let i=arg.length;i>0;i--)reverse+=arg[i-1],quoteHit&&arg[i-1]==="\\"?reverse+="\\":arg[i-1]==='"'?(quoteHit=!0,reverse+="\\"):quoteHit=!1;return reverse+='"',reverse.split("").reverse().join("")}_cloneExecOptions(options){options=options||{};let result={cwd:options.cwd||process.cwd(),env:options.env||process.env,silent:options.silent||!1,windowsVerbatimArguments:options.windowsVerbatimArguments||!1,failOnStdErr:options.failOnStdErr||!1,ignoreReturnCode:options.ignoreReturnCode||!1,delay:options.delay||1e4};return result.outStream=options.outStream||process.stdout,result.errStream=options.errStream||process.stderr,result}_getSpawnOptions(options,toolPath){options=options||{};let result={};return result.cwd=options.cwd,result.env=options.env,result.windowsVerbatimArguments=options.windowsVerbatimArguments||this._isCmdFile(),options.windowsVerbatimArguments&&(result.argv0=`"${toolPath}"`),result}exec(){return __awaiter(this,void 0,void 0,function*(){return!ioUtil.isRooted(this.toolPath)&&(this.toolPath.includes("/")||IS_WINDOWS&&this.toolPath.includes("\\"))&&(this.toolPath=path.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield io.which(this.toolPath,!0),new Promise((resolve,reject)=>__awaiter(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(let arg of this.args)this._debug(` ${arg}`);let optionsNonNull=this._cloneExecOptions(this.options);!optionsNonNull.silent&&optionsNonNull.outStream&&optionsNonNull.outStream.write(this._getCommandString(optionsNonNull)+os.EOL);let state=new ExecState(optionsNonNull,this.toolPath);if(state.on("debug",message=>{this._debug(message)}),this.options.cwd&&!(yield ioUtil.exists(this.options.cwd)))return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));let fileName=this._getSpawnFileName(),cp=child.spawn(fileName,this._getSpawnArgs(optionsNonNull),this._getSpawnOptions(this.options,fileName)),stdbuffer="";cp.stdout&&cp.stdout.on("data",data=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(data),!optionsNonNull.silent&&optionsNonNull.outStream&&optionsNonNull.outStream.write(data),stdbuffer=this._processLineBuffer(data,stdbuffer,line=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(line)})});let errbuffer="";if(cp.stderr&&cp.stderr.on("data",data=>{state.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(data),!optionsNonNull.silent&&optionsNonNull.errStream&&optionsNonNull.outStream&&(optionsNonNull.failOnStdErr?optionsNonNull.errStream:optionsNonNull.outStream).write(data),errbuffer=this._processLineBuffer(data,errbuffer,line=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(line)})}),cp.on("error",err=>{state.processError=err.message,state.processExited=!0,state.processClosed=!0,state.CheckComplete()}),cp.on("exit",code=>{state.processExitCode=code,state.processExited=!0,this._debug(`Exit code ${code} received from tool '${this.toolPath}'`),state.CheckComplete()}),cp.on("close",code=>{state.processExitCode=code,state.processExited=!0,state.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),state.CheckComplete()}),state.on("done",(error,exitCode)=>{stdbuffer.length>0&&this.emit("stdline",stdbuffer),errbuffer.length>0&&this.emit("errline",errbuffer),cp.removeAllListeners(),error?reject(error):resolve(exitCode)}),this.options.input){if(!cp.stdin)throw new Error("child process missing stdin");cp.stdin.end(this.options.input)}}))})}};exports.ToolRunner=ToolRunner;function argStringToArray(argString){let args=[],inQuotes=!1,escaped=!1,arg="";function append(c){escaped&&c!=='"'&&(arg+="\\"),arg+=c,escaped=!1}for(let i=0;i0&&(args.push(arg),arg="");continue}append(c)}return arg.length>0&&args.push(arg.trim()),args}exports.argStringToArray=argStringToArray;var ExecState=class _ExecState extends events.EventEmitter{constructor(options,toolPath){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!toolPath)throw new Error("toolPath must not be empty");this.options=options,this.toolPath=toolPath,options.delay&&(this.delay=options.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=timers_1.setTimeout(_ExecState.HandleTimeout,this.delay,this)))}_debug(message){this.emit("debug",message)}_setResult(){let error;this.processExited&&(this.processError?error=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?error=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(error=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",error,this.processExitCode)}static HandleTimeout(state){if(!state.done){if(!state.processClosed&&state.processExited){let message=`The STDIO streams did not close within ${state.delay/1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;state._debug(message)}state._setResult()}}}}});var require_exec=__commonJS({"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.getExecOutput=exports.exec=void 0;var string_decoder_1=require("string_decoder"),tr=__importStar(require_toolrunner());function exec5(commandLine,args,options){return __awaiter(this,void 0,void 0,function*(){let commandArgs=tr.argStringToArray(commandLine);if(commandArgs.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");let toolPath=commandArgs[0];return args=commandArgs.slice(1).concat(args||[]),new tr.ToolRunner(toolPath,args,options).exec()})}exports.exec=exec5;function getExecOutput(commandLine,args,options){var _a,_b;return __awaiter(this,void 0,void 0,function*(){let stdout="",stderr="",stdoutDecoder=new string_decoder_1.StringDecoder("utf8"),stderrDecoder=new string_decoder_1.StringDecoder("utf8"),originalStdoutListener=(_a=options?.listeners)===null||_a===void 0?void 0:_a.stdout,originalStdErrListener=(_b=options?.listeners)===null||_b===void 0?void 0:_b.stderr,stdErrListener=data=>{stderr+=stderrDecoder.write(data),originalStdErrListener&&originalStdErrListener(data)},stdOutListener=data=>{stdout+=stdoutDecoder.write(data),originalStdoutListener&&originalStdoutListener(data)},listeners=Object.assign(Object.assign({},options?.listeners),{stdout:stdOutListener,stderr:stdErrListener}),exitCode=yield exec5(commandLine,args,Object.assign(Object.assign({},options),{listeners}));return stdout+=stdoutDecoder.end(),stderr+=stderrDecoder.end(),{exitCode,stdout,stderr}})}exports.getExecOutput=getExecOutput}});var core=__toESM(require_core()),import_exec=__toESM(require_exec()),import_promises=require("node:fs/promises"),import_node_os=require("node:os"),import_node_path=require("node:path"),install=async()=>{core.startGroup("Install attic"),core.info("Installing attic");let installScript=await fetch("https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh").then(r=>(r.ok||(core.setFailed(`Action failed with error: ${r.statusText}`),core.endGroup(),process.exit(1)),r.text()));try{let installScriptPath=(0,import_node_path.join)((0,import_node_os.tmpdir)(),"install-attic-ci.sh");await(0,import_promises.writeFile)(installScriptPath,installScript),core.info("Running install script"),await(0,import_exec.exec)("bash",[installScriptPath])}catch(e){core.setFailed(`Action failed with error: ${e}`)}core.endGroup()};var core2=__toESM(require_core()),import_exec3=__toESM(require_exec());var import_exec2=__toESM(require_exec()),import_promises2=require("node:fs/promises"),saveStorePaths=async()=>{await(0,import_exec2.exec)("sh",["-c","nix path-info --all --json > /tmp/store-paths"])},getStorePaths=async()=>JSON.parse(await(0,import_promises2.readFile)("/tmp/store-paths","utf8")).map(path=>path.path);var configure=async()=>{core2.startGroup("Configure attic");try{let endpoint=core2.getInput("endpoint"),cache=core2.getInput("cache"),token=core2.getInput("token"),skipUse=core2.getInput("skip-use");core2.info("Logging in to attic cache"),await(0,import_exec3.exec)("attic",["login","--set-default",cache,endpoint,token]),skipUse==="true"?core2.info("Not adding attic cache to substituters as skip-use is set to true"):(core2.info("Adding attic cache to substituters"),await(0,import_exec3.exec)("attic",["use",cache])),core2.info("Collecting store paths before build"),await saveStorePaths()}catch(e){core2.setFailed(`Action failed with error: ${e}`)}core2.endGroup()};var core3=__toESM(require_core()),import_exec4=__toESM(require_exec());var arraySplit=split;function split(arr,n){if(!Array.isArray(arr))throw new Error("expected an array for the first argument");if(n!=null&&typeof n!="number")throw new Error("expected a number or null/undefined for the second argument");n=n??arr.length;for(var len=arr.length,groups=[],i=0;i{core3.startGroup("Push to Attic");try{if(core3.getInput("skip-push")==="true")core3.info("Pushing to cache is disabled by skip-push");else{let cache=core3.getInput("cache");core3.info("Pushing to cache");let oldPaths=await getStorePaths();await saveStorePaths();let addedPaths=(await getStorePaths()).filter(p=>!oldPaths.includes(p)).filter(p=>!p.endsWith(".drv")&&!p.endsWith(".drv.chroot")&&!p.endsWith(".check")&&!p.endsWith(".lock")),splitAddedPaths=arraySplit(addedPaths,25);for(let addedPaths2 of splitAddedPaths)await(0,import_exec4.exec)("attic",["push",cache,...addedPaths2])}}catch(e){core3.warning(`Action encountered error: ${e}`),core3.info("Not considering errors during push a failure.")}core3.endGroup()};var import_core=__toESM(require_core()),isPost=!!(0,import_core.getState)("isPost"),main=async()=>{await install(),await configure()};isPost?push():((0,import_core.saveState)("isPost",!0),main()); diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 3de746d..0000000 --- a/flake.lock +++ /dev/null @@ -1,26 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1689850295, - "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 80098a4..0000000 --- a/flake.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - description = "Github Action for caching Nix derivations with attic"; - - inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; - }; - - outputs = {nixpkgs, ...}: let - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system}); - in { - devShells = forAllSystems (pkgs: { - default = pkgs.mkShell { - packages = with pkgs; [ - actionlint - nodejs_20 - (nodePackages_latest.pnpm.override {nodejs = nodejs_20;}) - ]; - }; - }); - - formatter = forAllSystems (p: p.alejandra); - }; -} diff --git a/package.json b/package.json deleted file mode 100644 index 508a181..0000000 --- a/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@ryanccn/attic-action", - "main": "dist/index.js", - "description": "Cache Nix derivations with attic", - "scripts": { - "build": "esbuild src/index.ts --outdir=dist --platform=node --format=cjs --bundle --minify-whitespace --minify-syntax", - "format": "prettier --write ." - }, - "author": "Ryan Cao ", - "license": "MIT", - "dependencies": { - "@actions/core": "^1.10.0", - "@actions/exec": "^1.1.1", - "just-split": "^3.2.0" - }, - "devDependencies": { - "@types/node": "^16.18.38", - "esbuild": "^0.18.14", - "prettier": "3.0.0", - "typescript": "^5.1.6" - }, - "packageManager": "pnpm@8.7.5" -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 47ee9dc..0000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,313 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - '@actions/core': - specifier: ^1.10.0 - version: 1.10.0 - '@actions/exec': - specifier: ^1.1.1 - version: 1.1.1 - just-split: - specifier: ^3.2.0 - version: 3.2.0 - -devDependencies: - '@types/node': - specifier: ^16.18.38 - version: 16.18.38 - esbuild: - specifier: ^0.18.14 - version: 0.18.14 - prettier: - specifier: 3.0.0 - version: 3.0.0 - typescript: - specifier: ^5.1.6 - version: 5.1.6 - -packages: - - /@actions/core@1.10.0: - resolution: {integrity: sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==} - dependencies: - '@actions/http-client': 2.1.0 - uuid: 8.3.2 - dev: false - - /@actions/exec@1.1.1: - resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} - dependencies: - '@actions/io': 1.1.3 - dev: false - - /@actions/http-client@2.1.0: - resolution: {integrity: sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==} - dependencies: - tunnel: 0.0.6 - dev: false - - /@actions/io@1.1.3: - resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} - dev: false - - /@esbuild/android-arm64@0.18.14: - resolution: {integrity: sha512-rZ2v+Luba5/3D6l8kofWgTnqE+qsC/L5MleKIKFyllHTKHrNBMqeRCnZI1BtRx8B24xMYxeU32iIddRQqMsOsg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-arm@0.18.14: - resolution: {integrity: sha512-blODaaL+lngG5bdK/t4qZcQvq2BBqrABmYwqPPcS5VRxrCSGHb9R/rA3fqxh7R18I7WU4KKv+NYkt22FDfalcg==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-x64@0.18.14: - resolution: {integrity: sha512-qSwh8y38QKl+1Iqg+YhvCVYlSk3dVLk9N88VO71U4FUjtiSFylMWK3Ugr8GC6eTkkP4Tc83dVppt2n8vIdlSGg==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-arm64@0.18.14: - resolution: {integrity: sha512-9Hl2D2PBeDYZiNbnRKRWuxwHa9v5ssWBBjisXFkVcSP5cZqzZRFBUWEQuqBHO4+PKx4q4wgHoWtfQ1S7rUqJ2Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-x64@0.18.14: - resolution: {integrity: sha512-ZnI3Dg4ElQ6tlv82qLc/UNHtFsgZSKZ7KjsUNAo1BF1SoYDjkGKHJyCrYyWjFecmXpvvG/KJ9A/oe0H12odPLQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-arm64@0.18.14: - resolution: {integrity: sha512-h3OqR80Da4oQCIa37zl8tU5MwHQ7qgPV0oVScPfKJK21fSRZEhLE4IIVpmcOxfAVmqjU6NDxcxhYaM8aDIGRLw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-x64@0.18.14: - resolution: {integrity: sha512-ha4BX+S6CZG4BoH9tOZTrFIYC1DH13UTCRHzFc3GWX74nz3h/N6MPF3tuR3XlsNjMFUazGgm35MPW5tHkn2lzQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm64@0.18.14: - resolution: {integrity: sha512-IXORRe22In7U65NZCzjwAUc03nn8SDIzWCnfzJ6t/8AvGx5zBkcLfknI+0P+hhuftufJBmIXxdSTbzWc8X/V4w==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm@0.18.14: - resolution: {integrity: sha512-5+7vehI1iqru5WRtJyU2XvTOvTGURw3OZxe3YTdE9muNNIdmKAVmSHpB3Vw2LazJk2ifEdIMt/wTWnVe5V98Kg==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ia32@0.18.14: - resolution: {integrity: sha512-BfHlMa0nibwpjG+VXbOoqJDmFde4UK2gnW351SQ2Zd4t1N3zNdmUEqRkw/srC1Sa1DRBE88Dbwg4JgWCbNz/FQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-loong64@0.18.14: - resolution: {integrity: sha512-j2/Ex++DRUWIAaUDprXd3JevzGtZ4/d7VKz+AYDoHZ3HjJzCyYBub9CU1wwIXN+viOP0b4VR3RhGClsvyt/xSw==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-mips64el@0.18.14: - resolution: {integrity: sha512-qn2+nc+ZCrJmiicoAnJXJJkZWt8Nwswgu1crY7N+PBR8ChBHh89XRxj38UU6Dkthl2yCVO9jWuafZ24muzDC/A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ppc64@0.18.14: - resolution: {integrity: sha512-aGzXzd+djqeEC5IRkDKt3kWzvXoXC6K6GyYKxd+wsFJ2VQYnOWE954qV2tvy5/aaNrmgPTb52cSCHFE+Z7Z0yg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-riscv64@0.18.14: - resolution: {integrity: sha512-8C6vWbfr0ygbAiMFLS6OPz0BHvApkT2gCboOGV76YrYw+sD/MQJzyITNsjZWDXJwPu9tjrFQOVG7zijRzBCnLw==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-s390x@0.18.14: - resolution: {integrity: sha512-G/Lf9iu8sRMM60OVGOh94ZW2nIStksEcITkXdkD09/T6QFD/o+g0+9WVyR/jajIb3A0LvBJ670tBnGe1GgXMgw==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-x64@0.18.14: - resolution: {integrity: sha512-TBgStYBQaa3EGhgqIDM+ECnkreb0wkcKqL7H6m+XPcGUoU4dO7dqewfbm0mWEQYH3kzFHrzjOFNpSAVzDZRSJw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/netbsd-x64@0.18.14: - resolution: {integrity: sha512-stvCcjyCQR2lMTroqNhAbvROqRjxPEq0oQ380YdXxA81TaRJEucH/PzJ/qsEtsHgXlWFW6Ryr/X15vxQiyRXVg==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/openbsd-x64@0.18.14: - resolution: {integrity: sha512-apAOJF14CIsN5ht1PA57PboEMsNV70j3FUdxLmA2liZ20gEQnfTG5QU0FhENo5nwbTqCB2O3WDsXAihfODjHYw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/sunos-x64@0.18.14: - resolution: {integrity: sha512-fYRaaS8mDgZcGybPn2MQbn1ZNZx+UXFSUoS5Hd2oEnlsyUcr/l3c6RnXf1bLDRKKdLRSabTmyCy7VLQ7VhGdOQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-arm64@0.18.14: - resolution: {integrity: sha512-1c44RcxKEJPrVj62XdmYhxXaU/V7auELCmnD+Ri+UCt+AGxTvzxl9uauQhrFso8gj6ZV1DaORV0sT9XSHOAk8Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-ia32@0.18.14: - resolution: {integrity: sha512-EXAFttrdAxZkFQmpvcAQ2bywlWUsONp/9c2lcfvPUhu8vXBBenCXpoq9YkUvVP639ld3YGiYx0YUQ6/VQz3Maw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-x64@0.18.14: - resolution: {integrity: sha512-K0QjGbcskx+gY+qp3v4/940qg8JitpXbdxFhRDA1aYoNaPff88+aEwoq45aqJ+ogpxQxmU0ZTjgnrQD/w8iiUg==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@types/node@16.18.38: - resolution: {integrity: sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ==} - dev: true - - /esbuild@0.18.14: - resolution: {integrity: sha512-uNPj5oHPYmj+ZhSQeYQVFZ+hAlJZbAGOmmILWIqrGvPVlNLbyOvU5Bu6Woi8G8nskcx0vwY0iFoMPrzT86Ko+w==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.18.14 - '@esbuild/android-arm64': 0.18.14 - '@esbuild/android-x64': 0.18.14 - '@esbuild/darwin-arm64': 0.18.14 - '@esbuild/darwin-x64': 0.18.14 - '@esbuild/freebsd-arm64': 0.18.14 - '@esbuild/freebsd-x64': 0.18.14 - '@esbuild/linux-arm': 0.18.14 - '@esbuild/linux-arm64': 0.18.14 - '@esbuild/linux-ia32': 0.18.14 - '@esbuild/linux-loong64': 0.18.14 - '@esbuild/linux-mips64el': 0.18.14 - '@esbuild/linux-ppc64': 0.18.14 - '@esbuild/linux-riscv64': 0.18.14 - '@esbuild/linux-s390x': 0.18.14 - '@esbuild/linux-x64': 0.18.14 - '@esbuild/netbsd-x64': 0.18.14 - '@esbuild/openbsd-x64': 0.18.14 - '@esbuild/sunos-x64': 0.18.14 - '@esbuild/win32-arm64': 0.18.14 - '@esbuild/win32-ia32': 0.18.14 - '@esbuild/win32-x64': 0.18.14 - dev: true - - /just-split@3.2.0: - resolution: {integrity: sha512-hh57dN5koTBkmg3T6gBFISVVaW5bgZ6Ct1W5KODD5M7hQJKqGzTKkfMwOil8MBxyztLQEjh/v6UGXE8cP5tnqQ==} - dev: false - - /prettier@3.0.0: - resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} - engines: {node: '>=14'} - hasBin: true - dev: true - - /tunnel@0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - dev: false - - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true - dev: false diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index b40f47a..0000000 --- a/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { install } from "./stages/install"; -import { configure } from "./stages/configure"; -import { push } from "./stages/push"; -import { getState, saveState } from "@actions/core"; - -const isPost = !!getState("isPost"); - -const main = async () => { - await install(); - await configure(); -}; - -if (!isPost) { - saveState("isPost", true); - main(); -} else { - push(); -} diff --git a/src/stages/configure.ts b/src/stages/configure.ts deleted file mode 100644 index b427bf6..0000000 --- a/src/stages/configure.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as core from "@actions/core"; -import { exec } from "@actions/exec"; -import { saveStorePaths } from "../utils"; - -export const configure = async () => { - core.startGroup("Configure attic"); - - try { - const endpoint = core.getInput("endpoint"); - const cache = core.getInput("cache"); - const token = core.getInput("token"); - const skipUse = core.getInput("skip-use"); - - core.info("Logging in to attic cache"); - await exec("attic", ["login", "--set-default", cache, endpoint, token]); - - if (skipUse === "true") { - core.info("Not adding attic cache to substituters as skip-use is set to true"); - } else { - core.info("Adding attic cache to substituters"); - await exec("attic", ["use", cache]); - } - - core.info("Collecting store paths before build"); - await saveStorePaths(); - } catch (e) { - core.setFailed(`Action failed with error: ${e}`); - } - - core.endGroup(); -}; diff --git a/src/stages/install.ts b/src/stages/install.ts deleted file mode 100644 index 3014b9b..0000000 --- a/src/stages/install.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as core from "@actions/core"; -import { exec } from "@actions/exec"; - -import { writeFile } from "node:fs/promises"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; - -export const install = async () => { - core.startGroup("Install attic"); - - core.info("Installing attic"); - const installScript = await fetch( - "https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh", - ).then((r) => { - if (!r.ok) { - core.setFailed(`Action failed with error: ${r.statusText}`); - core.endGroup(); - process.exit(1); - } - - return r.text(); - }); - - try { - const installScriptPath = join(tmpdir(), "install-attic-ci.sh"); - - await writeFile(installScriptPath, installScript); - core.info("Running install script"); - await exec("bash", [installScriptPath]); - } catch (e) { - core.setFailed(`Action failed with error: ${e}`); - } - - core.endGroup(); -}; diff --git a/src/stages/push.ts b/src/stages/push.ts deleted file mode 100644 index f13e1fd..0000000 --- a/src/stages/push.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as core from "@actions/core"; -import { exec } from "@actions/exec"; - -import splitArray from "just-split"; -import { saveStorePaths, getStorePaths } from "../utils"; - -export const push = async () => { - core.startGroup("Push to Attic"); - - try { - const skipPush = core.getInput("skip-push"); - - if (skipPush === "true") { - core.info("Pushing to cache is disabled by skip-push"); - } else { - const cache = core.getInput("cache"); - - core.info("Pushing to cache"); - - const oldPaths = await getStorePaths(); - await saveStorePaths(); - const newPaths = await getStorePaths(); - const addedPaths = newPaths - .filter((p) => !oldPaths.includes(p)) - .filter( - (p) => !p.endsWith(".drv") && !p.endsWith(".drv.chroot") && !p.endsWith(".check") && !p.endsWith(".lock"), - ); - - const splitAddedPaths = splitArray(addedPaths, 25); - for (const addedPaths of splitAddedPaths) { - await exec("attic", ["push", cache, ...addedPaths]); - } - } - } catch (e) { - core.warning(`Action encountered error: ${e}`); - core.info("Not considering errors during push a failure."); - } - - core.endGroup(); -}; diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index f0218b9..0000000 --- a/src/utils.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { exec } from "@actions/exec"; - -import { readFile } from "node:fs/promises"; - -export const saveStorePaths = async () => { - await exec("sh", ["-c", "nix path-info --all --json > /tmp/store-paths"]); -}; -export const getStorePaths = async () => { - return (JSON.parse(await readFile("/tmp/store-paths", "utf8")) as { path: string }[]).map((path) => path.path); -}; diff --git a/test.nix b/test.nix deleted file mode 100644 index 73debb5..0000000 --- a/test.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - pkgs = import ( - fetchTarball { - url = - lock.nodes.nixpkgs.locked.url - or "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz"; - sha256 = lock.nodes.nixpkgs.locked.narHash; - } - ) {}; -in - pkgs.runCommand "non-reproducible-test" {} '' - echo ${toString builtins.currentTime} > $out - '' diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 1226785..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "downlevelIteration": true, - "module": "esnext", - "target": "esnext", - "moduleResolution": "node", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "skipLibCheck": true, - "noEmit": true - }, - "include": ["**/*.ts"], - "exclude": ["node_modules", "**/node_modules/*"] -}