setup-cpp/src/python/actions_python.ts

24 lines
916 B
TypeScript
Raw Normal View History

2021-09-20 20:24:17 +08:00
import * as core from "@actions/core"
import * as finder from "./setup-python/src/find-python"
import * as finderPyPy from "./setup-python/src/find-pypy"
import * as path from "path"
function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy-")
}
export async function setupActionsPython(version: string, _setupDir: string, arch: string) {
2021-09-20 20:24:17 +08:00
if (isPyPyVersion(version)) {
const installed = await finderPyPy.findPyPyVersion(version, arch)
core.info(
`Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
)
} else {
const installed = await finder.findPythonVersion(version, arch)
core.info(`Successfully setup ${installed.impl} (${installed.version})`)
}
const matchersPath = path.join("setup-pthon", ".github")
core.info(`##[add-matcher]${path.join(matchersPath, "python.json")}`)
return undefined
}