mirror of https://github.com/aminya/setup-cpp
3 lines
1.3 MiB
JavaScript
3 lines
1.3 MiB
JavaScript
|
function e(e){return e&&e.__esModule?e.default:e}function t(e,t,a,i){Object.defineProperty(e,t,{get:a,set:i,enumerable:!0,configurable:!0})}var a=require("path"),i=require("os"),r=require("fs"),s=require("util"),o=require("assert"),n=require("crypto"),p=require("url"),d=require("buffer"),l=require("stream"),c=require("events"),m=require("timers"),u=require("string_decoder"),h=require("http"),f=require("https"),g=require("zlib"),y=require("punycode"),x=require("child_process"),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},b=v.parcelRequire810d;b.register("ijScl",((i,r)=>{async function s(t,a,i){m.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");const r=process.env.AGENT_TOOLSDIRECTORY?.trim();if("string"==typeof r&&""!==r&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,d.debug)("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),t){let e;if(t.startsWith("pypy")){const a=await(0,n.findPyPyVersion)(t,i,!0,g);e=`${a.resolvedPyPyVersion}-${a.resolvedPythonVersion}`,(0,p.info)(`Successfully set up PyPy ${a.resolvedPyPyVersion} with Python (${a.resolvedPythonVersion})`)}else{const a=await(0,o.useCpythonVersion)(t,i,!0,g);e=a.version,(0,p.info)(`Successfully set up ${a.impl} (${e})`)}if((0,m.isCacheFeatureAvailable)()){const t="pip";await(async(e,t)=>{const a=(0,u.getCacheDistributor)(e,t,void 0);await a.restoreCache()})(t,e)}}"github-actions"===e(c)()&&await(async()=>{const t=(0,l.join)(f,"python_matcher.json");if(!await e(h)(t))return(0,p.warning)("the python_matcher.json file does not exist in the same folder as setup-cpp.js");(0,p.info)("::add-matcher::"+t)})()}t(i.exports,"setupActionsPython",(()=>s));var o=b("5OvYU"),n=b("eJiwB"),p=b("bouSm"),d=b("lXEOe"),l=b("jeNZZ"),c=b("dG9nM"),m=b("iiWGt"),u=b("brqN5"),h=b("8Xzrp"),f=a.resolve(__dirname,"../../src/python");const g=!1})),b.register("5OvYU",((e,r)=>{async function s(e,t,r,s){let c=null,m=e.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0").replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2");if(d.debug(`Semantic version spec of ${e} is ${m}`),s){c=await p.getManifest();const e=(await p.findReleaseFromManifest(m,t,c))?.version;e?(m=e,d.info(`Resolved as '${m}'`)):d.info(`Failed to resolve version ${m} from manifest`)}let u=l.find("Python",m,t);if(!u){d.info(`Version ${m} was not found in the local cache`);const e=await p.findReleaseFromManifest(m,t,c);e&&e.files&&e.files.length>0&&(d.info(`Version ${m} is available for downloading`),await p.installCpythonFromRelease(e),u=l.find("Python",m,t))}if(!u){const a=await(0,o.getOSInfo)();throw Error([`The version '${e}' with architecture '${t}' was not found for ${a?`${a.osName} ${a.osVersion}`:"this operating system"}.`,"The list of all available versions can be found here: "+p.MANIFEST_URL].join(i.EOL))}const h=(e=>a.join(e,o.IS_WINDOWS?"Scripts":"bin"))(u),f=a.join(o.IS_WINDOWS?u:h,"python"+(o.IS_WINDOWS?".exe":""));if(r){if(d.exportVariable("pythonLocation",u),d.exportVariable("PKG_CONFIG_PATH",u+"/lib/pkgconfig"),d.exportVariable("pythonLocation",u),d.exportVariable("Python_ROOT_DIR",u),d.exportVariable("Python2_ROOT_DIR",u),d.exportVariable("Python3_ROOT_DIR",u),d.exportVariable("PKG_CONFIG_PATH",u+"/lib/pkgconfig"),o.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",t=a.join(u,"lib");e.split(":").includes(t)||d.exportVariable("LD_LIBRARY_PATH",t+e)}if(d.addPath(u),d.addPath(h),o.IS_WINDOWS){const e=a.basename(a.dirname(u)),t=n.major(e),i=n.minor(e),r=a.join(process.env.APPDATA||"","Python",`Python${t}${i}`,"Scripts");d.addPath(r)}}const g=(e=>{const t=e.split(a.sep),i=t.findIndex((e=>"PyPy"===e||"Python"===e));return t[i+1]||""})(u);return d.setOutput("python-version",g),d.setOutput("python-path",f),{impl:"CPython",version:g}}t(e.exports,"useCpythonVersion",(()=>s));var o=b("iiWGt"),n=b("cTdPL"),p=b("7pNe6"),d=b("lXEOe"),l=b("bafIx")})),b.register("iiWGt",((i,s)=>{function o(t,i,s,o=!1){const n=a.join(t,i),p=a.join(t,s);e(r).existsSync(
|
||
|
//# sourceMappingURL=actions_python.26b5d445.js.map
|