1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 04:42:20 +02:00

Add check-latest functionality (#406)

This commit is contained in:
Dmitry Shibanov 2022-07-25 16:54:04 +02:00 committed by GitHub
parent 49a521fa06
commit 2f06e9da25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 440 additions and 82 deletions

View file

@ -19,11 +19,13 @@ import {
export async function installPyPy(
pypyVersion: string,
pythonVersion: string,
architecture: string
architecture: string,
releases: IPyPyManifestRelease[] | undefined
) {
let downloadDir;
const releases = await getAvailablePyPyVersions();
releases = releases ?? (await getAvailablePyPyVersions());
if (!releases || releases.length === 0) {
throw new Error('No release was found in PyPy version.json');
}
@ -78,7 +80,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');