add check-latest for pypy

This commit is contained in:
Dmitry Shibanov 2022-05-06 09:50:12 +02:00
parent 4841389b47
commit 73adf61d1f
8 changed files with 165 additions and 31 deletions

View file

@ -19,11 +19,12 @@ import {
export async function installPyPy(
pypyVersion: string,
pythonVersion: string,
architecture: string
architecture: string,
releases: IPyPyManifestRelease[] | undefined
) {
let downloadDir;
const releases = await getAvailablePyPyVersions();
releases ??= await getAvailablePyPyVersions();
if (!releases || releases.length === 0) {
throw new Error('No release was found in PyPy version.json');
}
@ -78,7 +79,7 @@ export async function installPyPy(
return {installDir, resolvedPythonVersion, resolvedPyPyVersion};
}
async function getAvailablePyPyVersions() {
export async function getAvailablePyPyVersions() {
const url = 'https://downloads.python.org/pypy/versions.json';
const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');