mirror of https://github.com/aminya/setup-cpp
3 lines
1.4 MiB
JavaScript
3 lines
1.4 MiB
JavaScript
|
function e(e){return e&&e.__esModule?e.default:e}function a(e,a,t,i){Object.defineProperty(e,a,{get:t,set:i,enumerable:!0,configurable:!0})}var t=require("fs"),i=require("path"),o=require("os"),s=require("util"),r=require("assert"),n=require("crypto"),p=require("url"),d=require("buffer"),l=require("stream"),m=require("http"),c=require("https"),u=require("punycode"),h=require("zlib"),g=require("string_decoder"),f=require("events"),y=require("timers"),b=require("child_process"),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},x=v.parcelRequire810d;x.register("apy8x",((o,s)=>{async function r(a,i,o){var s;if(u.IS_WINDOWS||(null===(s=process.env.AGENT_TOOLSDIRECTORY)||void 0===s?void 0:s.trim())||(process.env.AGENT_TOOLSDIRECTORY=u.IS_LINUX?"/opt/hostedtoolcache":"/Users/runner/hostedtoolcache",process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,l.debug)("Python is expected to be installed into RUNNER_TOOL_CACHE="+process.env.RUNNER_TOOL_CACHE),a){let e;if(a.startsWith("pypy")){const t=await(0,p.findPyPyVersion)(a,o,!0);e=`${t.resolvedPyPyVersion}-${t.resolvedPythonVersion}`,(0,d.info)(`Successfully set up PyPy ${t.resolvedPyPyVersion} with Python (${t.resolvedPythonVersion})`)}else{const t=await(0,n.useCpythonVersion)(a,o,!0);e=t.version,(0,d.info)(`Successfully set up ${t.impl} (${e})`)}if((0,u.isCacheFeatureAvailable)()){const a="pip";await(async(e,a)=>{const t=(0,h.getCacheDistributor)(e,a,void 0);await t.restoreCache()})(a,e)}}"github-actions"===e(c)()&&(()=>{const e=(0,m.join)(g,"python_matcher.json");if(!(0,t.existsSync)(e))return(0,d.warning)("the python_matcher.json file does not exist in the same folder as setup_cpp.js");(0,d.info)("::add-matcher::"+e)})()}a(o.exports,"setupActionsPython",(()=>r));var n=x("62Esx"),p=x("a1dcp"),d=x("pcnv8"),l=x("enS5B"),m=x("6XIgB"),c=x("gmbrv"),u=x("9eVbN"),h=x("kuU8s"),g=i.resolve(__dirname,"../src/python")})),x.register("62Esx",((e,t)=>{async function s(e,a,t){const s=e.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0").replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2");d.debug(`Semantic version spec of ${e} is ${s}`);let m=l.find("Python",s,a);if(!m){d.info(`Version ${s} was not found in the local cache`);const e=await p.findReleaseFromManifest(s,a);e&&e.files&&e.files.length>0&&(d.info(`Version ${s} is available for downloading`),await p.installCpythonFromRelease(e),m=l.find("Python",s,a))}if(!m)throw Error([`Version ${e} with arch ${a} not found`,"The list of all available versions can be found here: "+p.MANIFEST_URL].join(o.EOL));const c=(e=>i.join(e,r.IS_WINDOWS?"Scripts":"bin"))(m),u=i.join(r.IS_WINDOWS?m:c,"python"+(r.IS_WINDOWS?".exe":""));if(t){if(d.exportVariable("pythonLocation",m),d.exportVariable("PKG_CONFIG_PATH",m+"/lib/pkgconfig"),d.exportVariable("pythonLocation",m),d.exportVariable("Python_ROOT_DIR",m),d.exportVariable("Python2_ROOT_DIR",m),d.exportVariable("Python3_ROOT_DIR",m),d.exportVariable("PKG_CONFIG_PATH",m+"/lib/pkgconfig"),r.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",a=i.join(m,"lib");e.split(":").includes(a)||d.exportVariable("LD_LIBRARY_PATH",a+e)}if(d.addPath(m),d.addPath(c),r.IS_WINDOWS){const e=i.basename(i.dirname(m)),a=n.major(e),t=n.minor(e),o=i.join(process.env.APPDATA||"","Python",`Python${a}${t}`,"Scripts");d.addPath(o)}}const h=(e=>{const a=e.split(i.sep),t=a.findIndex((e=>"PyPy"===e||"Python"===e));return a[t+1]||""})(m);return d.setOutput("python-version",h),d.setOutput("python-path",u),{impl:"CPython",version:h}}a(e.exports,"useCpythonVersion",(()=>s));var r=x("9eVbN"),n=x("4URNm"),p=x("QrDxr"),d=x("enS5B"),l=x("1GQ3N")})),x.register("9eVbN",((o,s)=>{function r(a,o,s,r=!1){const n=i.join(a,o),p=i.join(a,s);e(t).existsSync(p)||(e(t).symlinkSync(n,p),!b&&r&&e(t).chmodSync(p,"755"))}function n(e){return p(e)||!!y.validRange(e)}function p(e){return"nightly"===e}function d(e){return i.basename(i.dirname(e))}function l(a){let o="",s=i.join(a,k);return e(t).existsSync(s)&&(o=""+e(t).readFileSync(s)),o}fun
|
||
|
//# sourceMappingURL=actions_python.f90e48a4.js.map
|