Add input manifest-file (#454)

Adds capability to maintain custom uv builds or to override the default
sources
This commit is contained in:
Kevin Stillhammer
2025-06-18 22:33:20 +02:00
committed by GitHub
parent 7bbb36f434
commit 60cc2b4585
14 changed files with 493 additions and 126 deletions

View File

@@ -1,9 +1,10 @@
import * as core from "@actions/core";
import * as path from "node:path";
import {
downloadVersion,
tryGetFromToolCache,
resolveVersion,
downloadVersionFromGithub,
downloadVersionFromManifest,
} from "./download/download-version";
import { restoreCache } from "./cache/restore-cache";
@@ -26,6 +27,7 @@ import {
version as versionInput,
workingDirectory,
serverUrl,
manifestFile,
} from "./utils/inputs";
import * as exec from "@actions/exec";
import fs from "node:fs";
@@ -95,14 +97,29 @@ async function setupUv(
};
}
const downloadVersionResult = await downloadVersion(
serverUrl,
platform,
arch,
resolvedVersion,
checkSum,
githubToken,
);
let downloadVersionResult: { version: string; cachedToolDir: string };
if (serverUrl !== "https://github.com") {
core.warning(
"The input server-url is deprecated. Please use manifest-file instead.",
);
downloadVersionResult = await downloadVersionFromGithub(
serverUrl,
platform,
arch,
resolvedVersion,
checkSum,
githubToken,
);
} else {
downloadVersionResult = await downloadVersionFromManifest(
manifestFile,
platform,
arch,
resolvedVersion,
checkSum,
githubToken,
);
}
return {
uvDir: downloadVersionResult.cachedToolDir,