Respect the mirror setting when selecting the version manifest (#1164)

Select the manifest source from the action inputs and keep version
resolution separate from archive downloads. Fetch the built-in manifest
directly from GitHub when the Astral mirror is disabled.

Fixes: #1140

Based on the work of @Rudra-G-23 in
https://github.com/astral-sh/setup-uv/pull/1152

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Kevin StillhammerandAmp authored and GitHub committed 2026-12-02 11:40:15 +01:00
1 parent 521745f16c
commit 36300bab3f
19 files changed
+1637 -1647

No files matched your search

Generated Vendored
+21 -8
View File
@@ -66230,6 +66230,19 @@ function getConfigValueFromTomlContent(filePath, fileContent, key) {
__name(getConfigValueFromTomlContent, "getConfigValueFromTomlContent");
// src/utils/inputs.ts
var VERSIONS_MANIFEST_URL = "https://releases.astral.sh/github/versions/main/v1/uv.ndjson";
var GITHUB_VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson";
var ASTRAL_MANIFEST = {
custom: false,
fallbackUrl: GITHUB_VERSIONS_MANIFEST_URL,
newestFirst: true,
url: VERSIONS_MANIFEST_URL
};
var GITHUB_MANIFEST = {
custom: false,
newestFirst: true,
url: GITHUB_VERSIONS_MANIFEST_URL
};
function loadInputs() {
const workingDirectory = getInput("working-directory");
const version3 = getInput("version");
@@ -66261,8 +66274,8 @@ function loadInputs() {
const toolDir = getToolDir(workingDirectory);
const pythonDir = getUvPythonDir();
const githubToken = getInput("github-token");
const manifestFile = getManifestFile();
const downloadFromAstralMirror = getInput("download-from-astral-mirror") === "true";
const manifestSource = getManifestSource(downloadFromAstralMirror);
const addProblemMatchers = getInput("add-problem-matchers") === "true";
const quiet2 = getInput("quiet") === "true";
const resolutionStrategy = getResolutionStrategy();
@@ -66280,7 +66293,7 @@ function loadInputs() {
githubToken,
ignoreEmptyWorkdir,
ignoreNothingToCache,
manifestFile,
manifestSource,
noProject,
pruneCache: pruneCache2,
pythonArch,
@@ -66528,14 +66541,14 @@ function resolveRelativePath(workingDirectory, inputPath) {
return hasNegation ? `!${resolvedPath}` : resolvedPath;
}
__name(resolveRelativePath, "resolveRelativePath");
function getManifestFile() {
const manifestFileInput = getInput("manifest-file");
if (manifestFileInput !== "") {
return manifestFileInput;
function getManifestSource(useAstralMirror) {
const manifestFile = getInput("manifest-file");
if (manifestFile !== "") {
return { custom: true, newestFirst: false, url: manifestFile };
}
return void 0;
return useAstralMirror ? ASTRAL_MANIFEST : GITHUB_MANIFEST;
}
__name(getManifestFile, "getManifestFile");
__name(getManifestSource, "getManifestSource");
function getResolutionStrategy() {
const resolutionStrategyInput = getInput("resolution-strategy");
if (resolutionStrategyInput === "lowest") {