mirror of
https://github.com/aminya/setup-cpp
synced 2024-11-30 21:22:30 +08:00
3 lines
1.4 MiB
JavaScript
3 lines
1.4 MiB
JavaScript
|
function e(e,a,t,i){Object.defineProperty(e,a,{get:t,set:i,enumerable:!0,configurable:!0})}function a(e){return e&&e.__esModule?e.default:e}import t,*as i from"fs";import o,*as s from"path";import r,*as n from"os";import p,*as d from"util";import*as l from"assert";import m,*as c from"crypto";import u,{URL as h,parse as g}from"url";import*as f from"buffer";import y,*as b from"stream";import v,*as x from"http";import w,*as N from"https";import*as k from"punycode";import S from"zlib";import{StringDecoder as j}from"string_decoder";import*as C from"events";import{setImmediate as T}from"timers";import{execSync as _,exec as P}from"child_process";var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},z=E.parcelRequire810d;z.register("doiKQ",((a,t)=>{async function i(e,a,t){var i;if(l.IS_WINDOWS||(null===(i=process.env.AGENT_TOOLSDIRECTORY)||void 0===i?void 0:i.trim())||(process.env.AGENT_TOOLSDIRECTORY=l.IS_LINUX?"/opt/hostedtoolcache":"/Users/runner/hostedtoolcache",process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,p.debug)("Python is expected to be installed into RUNNER_TOOL_CACHE="+process.env.RUNNER_TOOL_CACHE),e){let a;if(e.startsWith("pypy")){const i=await(0,r.findPyPyVersion)(e,t,!0);a=`${i.resolvedPyPyVersion}-${i.resolvedPythonVersion}`,(0,n.info)(`Successfully set up PyPy ${i.resolvedPyPyVersion} with Python (${i.resolvedPythonVersion})`)}else{const i=await(0,s.useCpythonVersion)(e,t,!0);a=i.version,(0,n.info)(`Successfully set up ${i.impl} (${a})`)}if((0,l.isCacheFeatureAvailable)()){const e="pip";await(async(e,a)=>{const t=(0,m.getCacheDistributor)(e,a,void 0);await t.restoreCache()})(e,a)}}(0,d.isGitHubCI)()&&(()=>{const e=o.join(c,"python_matcher.json");if(!$hwYwi$existsSync(e))return(0,n.warning)("the python_matcher.json file does not exist in the same folder as setup_cpp.js");(0,n.info)("::add-matcher::"+e)})()}e(a.exports,"setupActionsPython",(()=>i));var s=z("7nk62"),r=z("5Sr09"),n=z("81ovw"),p=z("gF2Jd"),d=z("j2P82"),l=z("5wuRJ"),m=z("ipccU"),c=$hwYwi$resolve(__dirname,"../src/python")})),z.register("7nk62",((a,t)=>{async function i(e,a,t){const i=e.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0").replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2");n.debug(`Semantic version spec of ${e} is ${i}`);let d=p.find("Python",i,a);if(!d){n.info(`Version ${i} was not found in the local cache`);const e=await r.findReleaseFromManifest(i,a);e&&e.files&&e.files.length>0&&(n.info(`Version ${i} is available for downloading`),await r.installCpythonFromRelease(e),d=p.find("Python",i,a))}if(!d)throw Error([`Version ${e} with arch ${a} not found`,"The list of all available versions can be found here: "+r.MANIFEST_URL].join($hwYwi$EOL));if(o.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",a=$hwYwi$join(d,"lib");e.split(":").includes(a)||n.exportVariable("LD_LIBRARY_PATH",a+e)}const l=(e=>o.IS_WINDOWS?$hwYwi$join(e,"Scripts"):$hwYwi$join(e,"bin"))(d),m=$hwYwi$join(o.IS_WINDOWS?d:l,"python"+(o.IS_WINDOWS?".exe":""));if(t){if(n.exportVariable("pythonLocation",d),n.exportVariable("PKG_CONFIG_PATH",d+"/lib/pkgconfig"),n.exportVariable("pythonLocation",d),n.exportVariable("Python_ROOT_DIR",d),n.exportVariable("Python2_ROOT_DIR",d),n.exportVariable("Python3_ROOT_DIR",d),n.exportVariable("PKG_CONFIG_PATH",d+"/lib/pkgconfig"),o.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",a=$hwYwi$join(d,"lib");e.split(":").includes(a)||n.exportVariable("LD_LIBRARY_PATH",a+e)}if(n.addPath(d),n.addPath(l),o.IS_WINDOWS){const e=$hwYwi$basename($hwYwi$dirname(d)),a=s.major(e),t=s.minor(e),i=$hwYwi$join(process.env.APPDATA||"","Python",`Python${a}${t}`,"Scripts");n.addPath(i)}}const c=(e=>{const a=e.split($hwYwi$sep),t=a.findIndex((e=>"PyPy"===e||"Python"===e));return a[t+1]||""})(d);return n.setOutput("python-version",c),n.setOutput("python-path",m),{impl:"CPython",version:c}}e(a.exports,"useCpythonVersion",(()=>i));var o=z("5wuRJ"),s=z("dsEdn"),r=z("8Q7nk"),n=z("gF2Jd"),p=z("8annq")})),
|
||
|
//# sourceMappingURL=actions_python.aa574a9a.js.map
|