added action output python-install-dir

* also fixed export of python-version for pypy installs
This commit is contained in:
Andreas Reischuck 2021-12-05 15:45:38 +01:00
parent f382193329
commit 7a537682ef
3 changed files with 7 additions and 0 deletions

View file

@ -19,6 +19,8 @@ inputs:
outputs: outputs:
python-version: python-version:
description: "The installed python version. Useful when given a version range as input." description: "The installed python version. Useful when given a version range as input."
python-install-dir:
description: "The path where python was installed. (PYTHON_INSTALL_DIR)"
runs: runs:
using: 'node12' using: 'node12'
main: 'dist/setup/index.js' main: 'dist/setup/index.js'

View file

@ -53,6 +53,9 @@ export async function findPyPyVersion(
core.addPath(pythonLocation); core.addPath(pythonLocation);
core.addPath(_binDir); core.addPath(_binDir);
core.setOutput('python-version', resolvedPythonVersion);
core.setOutput('python-install-dir', installDir);
return {resolvedPyPyVersion, resolvedPythonVersion}; return {resolvedPyPyVersion, resolvedPythonVersion};
} }

View file

@ -71,6 +71,7 @@ function usePyPy(
const impl = 'pypy' + majorVersion.toString(); const impl = 'pypy' + majorVersion.toString();
core.setOutput('python-version', impl); core.setOutput('python-version', impl);
core.setOutput('python-install-dir', installDir);
return {impl: impl, version: versionFromPath(installDir)}; return {impl: impl, version: versionFromPath(installDir)};
} }
@ -150,6 +151,7 @@ async function useCpythonVersion(
const installed = versionFromPath(installDir); const installed = versionFromPath(installDir);
core.setOutput('python-version', installed); core.setOutput('python-version', installed);
core.setOutput('python-install-dir', installDir);
return {impl: 'CPython', version: installed}; return {impl: 'CPython', version: installed};
} }