1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 21:02:19 +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

@ -14,20 +14,33 @@ export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_O
export async function findReleaseFromManifest(
semanticVersionSpec: string,
architecture: string
architecture: string,
manifest: tc.IToolRelease[] | null
): Promise<tc.IToolRelease | undefined> {
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
MANIFEST_REPO_OWNER,
MANIFEST_REPO_NAME,
AUTH,
MANIFEST_REPO_BRANCH
);
return await tc.findFromManifest(
if (!manifest) {
manifest = await getManifest();
}
const foundRelease = await tc.findFromManifest(
semanticVersionSpec,
false,
manifest,
architecture
);
return foundRelease;
}
export function getManifest(): Promise<tc.IToolRelease[]> {
core.debug(
`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`
);
return tc.getManifestFromRepo(
MANIFEST_REPO_OWNER,
MANIFEST_REPO_NAME,
AUTH,
MANIFEST_REPO_BRANCH
);
}
async function installPython(workingDirectory: string) {