mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-04-06 02:26:55 +00:00
Add input manifest-file (#454)
Adds capability to maintain custom uv builds or to override the default sources
This commit is contained in:
parent
7bbb36f434
commit
60cc2b4585
14 changed files with 493 additions and 126 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue