Compare commits

..

2 Commits

Author SHA1 Message Date
eifinger
0c4002208e chore: update known versions for 0.9.27 2026-01-27 04:19:05 +00:00
dependabot[bot]
085087a5d3 Bump zizmorcore/zizmor-action from 0.3.0 to 0.4.1 (#741)
Some checks failed
Release Drafter / ✏️ Draft release (push) Waiting to run
test / test-default-version (macos-14) (push) Waiting to run
test / test-default-version (macos-latest) (push) Waiting to run
test / test-checksum (map[checksum:a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218 os:macos-latest]) (push) Waiting to run
test / test-tilde-expansion-tool-dirs (push) Waiting to run
test / test-python-version (macos-latest) (push) Waiting to run
test / test-activate-environment (macos-latest) (push) Waiting to run
test / test-default-version (windows-latest) (push) Waiting to run
test / test-tool-install (macos-14) (push) Waiting to run
test / test-tool-install (macos-latest) (push) Waiting to run
test / test-tool-install (windows-latest) (push) Waiting to run
test / test-python-version (windows-latest) (push) Waiting to run
test / test-activate-environment (windows-latest) (push) Waiting to run
test / test-cache-key-os-version (macos-14, macos-14) (push) Waiting to run
test / test-cache-key-os-version (macos-15, macos-15) (push) Waiting to run
test / test-cache-key-os-version (ubuntu-24.04, ubuntu-24.04) (push) Waiting to run
test / test-cache-key-os-version (windows-2022, windows-2022) (push) Waiting to run
test / test-cache-key-os-version (windows-2025, windows-2025) (push) Waiting to run
test / test-setup-cache (auto, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (auto, windows-latest) (push) Waiting to run
test / test-setup-cache (false, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (false, windows-latest) (push) Waiting to run
test / test-setup-cache (true, selfhosted-ubuntu-arm64) (push) Waiting to run
test / test-setup-cache (true, windows-latest) (push) Waiting to run
test / test-restore-cache (auto, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (auto, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (auto, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (false, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (false, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (false, windows-latest) (push) Blocked by required conditions
test / test-restore-cache (true, selfhosted-ubuntu-arm64) (push) Blocked by required conditions
test / test-restore-cache (true, ubuntu-latest) (push) Blocked by required conditions
test / test-restore-cache (true, windows-latest) (push) Blocked by required conditions
test / test-cache-local (map[expected-cache-dir:/home/ubuntu/.cache/uv os:selfhosted-ubuntu-arm64]) (push) Waiting to run
test / test-cache-local (map[expected-cache-dir:D:\a\_temp\setup-uv-cache os:windows-latest]) (push) Waiting to run
test / test-setup-cache-local (push) Waiting to run
test / test-restore-cache-local (push) Blocked by required conditions
test / test-tilde-expansion-cache-local-path (push) Waiting to run
test / test-tilde-expansion-cache-dependency-glob (push) Waiting to run
test / cleanup-tilde-expansion-tests (push) Blocked by required conditions
CodeQL / Analyze (TypeScript) (push) Failing after 6s
test / test-python-install-dir (map[expected-python-dir:/home/ubuntu/.local/share/uv/python os:selfhosted-ubuntu-arm64]) (push) Waiting to run
test / test-python-install-dir (map[expected-python-dir:D:\a\_temp\uv-python-dir os:windows-latest]) (push) Waiting to run
test / all-tests-passed (push) Blocked by required conditions
test / lint (push) Failing after 6s
test / test-specific-version (map[expected-version:0.1.0 resolution-strategy:lowest version-input:>=0.1.0,<0.2]) (push) Failing after 6s
test / test-default-version (ubuntu-latest) (push) Failing after 6s
test / test-uv-no-modify-path (push) Failing after 6s
test / test-specific-version (map[expected-version:0.1.45 resolution-strategy:highest version-input:>=0.1,<0.2]) (push) Failing after 6s
test / test-specific-version (map[expected-version:0.3.0 version-input:0.3.0]) (push) Failing after 6s
test / test-specific-version (map[expected-version:0.3.2 version-input:0.3.2]) (push) Failing after 6s
test / test-specific-version (map[expected-version:0.4.25 resolution-strategy:lowest version-input:>=0.4.25,<0.5]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.4.25 resolution-strategy:lowest version-input:>=0.4.25]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.3.5 version-input:0.3]) (push) Failing after 5s
test / test-specific-version (map[expected-version:0.3.5 version-input:0.3.x]) (push) Failing after 6s
test / test-specific-version (map[expected-version:0.4.30 version-input:>=0.4.25,<0.5]) (push) Failing after 6s
test / test-latest-version (>=0.8) (push) Failing after 5s
test / test-latest-version (latest) (push) Failing after 6s
test / test-from-working-directory-version (map[expected-version:0.5.14 working-directory:__tests__/fixtures/pyproject-toml-project]) (push) Failing after 7s
test / test-version-file-version (map[expected-version:0.5.15 version-file:__tests__/fixtures/.tool-versions]) (push) Failing after 7s
test / test-from-working-directory-version (map[expected-version:0.5.15 working-directory:__tests__/fixtures/uv-toml-project]) (push) Failing after 7s
test / test-version-file-version (map[expected-version:0.6.17 version-file:__tests__/fixtures/uv-in-requirements-txt-project/requirements.txt]) (push) Failing after 7s
test / test-malformed-pyproject-file-fallback (push) Failing after 7s
test / test-version-file-version (map[expected-version:0.8.3 version-file:__tests__/fixtures/uv-in-requirements-hash-txt-project/requirements.txt]) (push) Failing after 7s
test / test-checksum (map[checksum:4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd os:ubuntu-latest]) (push) Failing after 7s
test / test-with-explicit-token (push) Failing after 8s
test / test-uvx (push) Failing after 8s
test / test-tool-install (ubuntu-latest) (push) Failing after 8s
test / test-setup-cache (auto, ubuntu-latest) (push) Failing after 7s
test / test-python-version (ubuntu-latest) (push) Failing after 9s
test / test-activate-environment (ubuntu-latest) (push) Failing after 9s
test / test-setup-cache (true, ubuntu-latest) (push) Failing after 8s
test / test-setup-cache (false, ubuntu-latest) (push) Failing after 7s
test / test-setup-cache-requirements-txt (push) Failing after 10s
test / test-setup-cache-dependency-glob (push) Failing after 8s
test / test-restore-cache-requirements-txt (push) Has been skipped
test / test-restore-cache-dependency-glob (push) Has been skipped
test / test-restore-cache-save-cache-false (push) Has been skipped
test / test-setup-cache-save-cache-false (push) Failing after 9s
test / test-restore-cache-restore-cache-false (push) Has been skipped
test / test-setup-cache-restore-cache-false (push) Failing after 9s
test / test-musl (push) Failing after 19s
test / test-cache-local (map[expected-cache-dir:/home/runner/work/_temp/setup-uv-cache os:ubuntu-latest]) (push) Failing after 10s
test / test-cache-local-cache-disabled (push) Failing after 9s
test / test-cache-local-cache-disabled-but-explicit-path (push) Failing after 10s
test / test-no-python-version (push) Failing after 9s
test / test-custom-manifest-file (push) Failing after 10s
test / test-absolute-path (push) Failing after 10s
test / test-relative-path (push) Failing after 10s
test / test-cache-prune-force (push) Failing after 10s
test / test-cache-dir-from-file (push) Failing after 10s
test / test-cache-key-os-version (ubuntu-22.04, ubuntu-22.04) (push) Failing after 29s
test / test-cache-python-installs (push) Failing after 11s
test / test-restore-python-installs (push) Has been skipped
test / test-python-install-dir (map[expected-python-dir:/home/runner/work/_temp/uv-python-dir os:ubuntu-latest]) (push) Failing after 11s
test / test-act (push) Failing after 12s
test / validate-typings (push) Failing after 12s
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-26 12:16:54 +00:00
9 changed files with 9701 additions and 5282 deletions

View File

@@ -27,7 +27,7 @@ jobs:
- name: Actionlint
uses: eifinger/actionlint-action@213860089b7cf97d640aa67567898fabeb132746 # v1.9.3
- name: Run zizmor
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
uses: zizmorcore/zizmor-action@135698455da5c3b3e55f73f4419e481ab68cdd95 # v0.4.1
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: .nvmrc

4360
dist/setup/index.js generated vendored

File diff suppressed because it is too large Load Diff

38
dist/update-known-versions/index.js generated vendored
View File

@@ -28196,6 +28196,24 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KNOWN_CHECKSUMS = void 0;
// AUTOGENERATED_DO_NOT_EDIT
exports.KNOWN_CHECKSUMS = {
"aarch64-apple-darwin-0.9.27": "1359538ed8664d172692cf4719ee0933a4a3bfb22fc91b0be1e19e7bdd8f5ef3",
"aarch64-pc-windows-msvc-0.9.27": "b448ab228f5d1165b8497e8ca10346af6f652eb8ad4e75e47fa55e8cdb5b60d7",
"aarch64-unknown-linux-gnu-0.9.27": "a58b3b77a25620ae15ff3587049b755c7cbf3eaa7df187620b3e6c3dbf71daa0",
"aarch64-unknown-linux-musl-0.9.27": "f80e97e1154a06e42143a173831289336ca9e34a67096ab070346958153e8e52",
"arm-unknown-linux-musleabihf-0.9.27": "b80f4db9254b9ddec4b576190bdf15723e948f37f648d9b273be2e153d05f820",
"armv7-unknown-linux-gnueabihf-0.9.27": "03b45c99ca940739c2a093f6a514da3dd858b3bc1e8c957c16c1832e30b30c28",
"armv7-unknown-linux-musleabihf-0.9.27": "da43ee6e2f17b4646e35e2d55ce6a021fdf47c06601a6ae8b827de7bb7b3b02f",
"i686-pc-windows-msvc-0.9.27": "f47831a97b8a1bc7c7211905c1e517cc2f4ef84df877f2a283c49609275db0fa",
"i686-unknown-linux-gnu-0.9.27": "fdf3067e0c05d39b849ad48fbbc2b58919f70a686a40506c643d32688ceba1a9",
"i686-unknown-linux-musl-0.9.27": "3c1f8c2b148ebf884311558aaff32b9fb5b68fe4f4242e3e3765381bb594386a",
"powerpc64-unknown-linux-gnu-0.9.27": "c3cbda5118b06f2261d32f4802adfdc71f618f808df0c6a3184695a6ffecb88a",
"powerpc64le-unknown-linux-gnu-0.9.27": "9011f6085cee3921c9fce82ce03041ca97aacc8cab86b7a5791faa71fa5f2712",
"riscv64gc-unknown-linux-gnu-0.9.27": "7193628620c2c50c2d6632ea8e53a4ab5313f7e8003ddedd9e999f48b6d2c222",
"s390x-unknown-linux-gnu-0.9.27": "5b055f02f2c8e5086ae1d05cf70d32d66982d27d8469ed896a65067fac2001d2",
"x86_64-apple-darwin-0.9.27": "3977309c5c79984c13c55d2d1cd7aa114a718eb29436c5bdb4bdfa08bf243438",
"x86_64-pc-windows-msvc-0.9.27": "c3bf465d5f2b93c836f369aec9f3fa8350843f24abd5f710bb74e72440b82898",
"x86_64-unknown-linux-gnu-0.9.27": "8636e693ea0e05f5f4294b161f816c4d8df065267fdb0405cfb84c8e326991fa",
"x86_64-unknown-linux-musl-0.9.27": "9f269bfb9c2e80808c373902af6a4af6cd5f4b4668b28c44aa09639cfed925c5",
"aarch64-apple-darwin-0.9.26": "fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f",
"aarch64-pc-windows-msvc-0.9.26": "79e1398ec98681b1b0494ed3485b0f4565e98a7db109a3f205d0fcdc6a1992f7",
"aarch64-unknown-linux-gnu-0.9.26": "f71040c59798f79c44c08a7a1c1af7de95a8d334ea924b47b67ad6b9632be270",
@@ -32482,10 +32500,8 @@ var __importStar = (this && this.__importStar) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.REMOTE_MANIFEST_URL = void 0;
exports.getLatestKnownVersion = getLatestKnownVersion;
exports.getDownloadUrl = getDownloadUrl;
exports.getAvailableVersionsFromManifest = getAvailableVersionsFromManifest;
exports.updateVersionManifest = updateVersionManifest;
const node_fs_1 = __nccwpck_require__(3024);
const node_path_1 = __nccwpck_require__(6760);
@@ -32493,9 +32509,6 @@ const core = __importStar(__nccwpck_require__(7484));
const semver = __importStar(__nccwpck_require__(9318));
const fetch_1 = __nccwpck_require__(3385);
const localManifestFile = (0, node_path_1.join)(__dirname, "..", "..", "version-manifest.json");
exports.REMOTE_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.json";
// Cache for manifest entries to avoid re-fetching
const manifestCache = new Map();
async function getLatestKnownVersion(manifestUrl) {
const manifestEntries = await getManifestEntries(manifestUrl);
return manifestEntries.reduce((a, b) => semver.gt(a.version, b.version) ? a : b).version;
@@ -32507,18 +32520,7 @@ async function getDownloadUrl(manifestUrl, version, arch, platform) {
entry.platform === platform);
return entry ? entry.downloadUrl : undefined;
}
async function getAvailableVersionsFromManifest(manifestUrl) {
const manifestEntries = await getManifestEntries(manifestUrl);
return [...new Set(manifestEntries.map((entry) => entry.version))];
}
async function getManifestEntries(manifestUrl) {
const cacheKey = manifestUrl ?? "local";
// Return cached entries if available
const cached = manifestCache.get(cacheKey);
if (cached !== undefined) {
core.debug(`Using cached manifest entries for: ${cacheKey}`);
return cached;
}
let data;
if (manifestUrl !== undefined) {
core.info(`Fetching manifest-file from: ${manifestUrl}`);
@@ -32533,9 +32535,7 @@ async function getManifestEntries(manifestUrl) {
const fileContent = await node_fs_1.promises.readFile(localManifestFile);
data = fileContent.toString();
}
const entries = JSON.parse(data);
manifestCache.set(cacheKey, entries);
return entries;
return JSON.parse(data);
}
async function updateVersionManifest(manifestUrl, downloadUrls) {
const manifest = [];

View File

@@ -1,5 +1,41 @@
// AUTOGENERATED_DO_NOT_EDIT
export const KNOWN_CHECKSUMS: { [key: string]: string } = {
"aarch64-apple-darwin-0.9.27":
"1359538ed8664d172692cf4719ee0933a4a3bfb22fc91b0be1e19e7bdd8f5ef3",
"aarch64-pc-windows-msvc-0.9.27":
"b448ab228f5d1165b8497e8ca10346af6f652eb8ad4e75e47fa55e8cdb5b60d7",
"aarch64-unknown-linux-gnu-0.9.27":
"a58b3b77a25620ae15ff3587049b755c7cbf3eaa7df187620b3e6c3dbf71daa0",
"aarch64-unknown-linux-musl-0.9.27":
"f80e97e1154a06e42143a173831289336ca9e34a67096ab070346958153e8e52",
"arm-unknown-linux-musleabihf-0.9.27":
"b80f4db9254b9ddec4b576190bdf15723e948f37f648d9b273be2e153d05f820",
"armv7-unknown-linux-gnueabihf-0.9.27":
"03b45c99ca940739c2a093f6a514da3dd858b3bc1e8c957c16c1832e30b30c28",
"armv7-unknown-linux-musleabihf-0.9.27":
"da43ee6e2f17b4646e35e2d55ce6a021fdf47c06601a6ae8b827de7bb7b3b02f",
"i686-pc-windows-msvc-0.9.27":
"f47831a97b8a1bc7c7211905c1e517cc2f4ef84df877f2a283c49609275db0fa",
"i686-unknown-linux-gnu-0.9.27":
"fdf3067e0c05d39b849ad48fbbc2b58919f70a686a40506c643d32688ceba1a9",
"i686-unknown-linux-musl-0.9.27":
"3c1f8c2b148ebf884311558aaff32b9fb5b68fe4f4242e3e3765381bb594386a",
"powerpc64-unknown-linux-gnu-0.9.27":
"c3cbda5118b06f2261d32f4802adfdc71f618f808df0c6a3184695a6ffecb88a",
"powerpc64le-unknown-linux-gnu-0.9.27":
"9011f6085cee3921c9fce82ce03041ca97aacc8cab86b7a5791faa71fa5f2712",
"riscv64gc-unknown-linux-gnu-0.9.27":
"7193628620c2c50c2d6632ea8e53a4ab5313f7e8003ddedd9e999f48b6d2c222",
"s390x-unknown-linux-gnu-0.9.27":
"5b055f02f2c8e5086ae1d05cf70d32d66982d27d8469ed896a65067fac2001d2",
"x86_64-apple-darwin-0.9.27":
"3977309c5c79984c13c55d2d1cd7aa114a718eb29436c5bdb4bdfa08bf243438",
"x86_64-pc-windows-msvc-0.9.27":
"c3bf465d5f2b93c836f369aec9f3fa8350843f24abd5f710bb74e72440b82898",
"x86_64-unknown-linux-gnu-0.9.27":
"8636e693ea0e05f5f4294b161f816c4d8df065267fdb0405cfb84c8e326991fa",
"x86_64-unknown-linux-musl-0.9.27":
"9f269bfb9c2e80808c373902af6a4af6cd5f4b4668b28c44aa09639cfed925c5",
"aarch64-apple-darwin-0.9.26":
"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f",
"aarch64-pc-windows-msvc-0.9.26":

View File

@@ -2,18 +2,21 @@ import { promises as fs } from "node:fs";
import * as path from "node:path";
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import type { Endpoints } from "@octokit/types";
import * as pep440 from "@renovatebot/pep440";
import * as semver from "semver";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
import { Octokit } from "../utils/octokit";
import type { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum";
import {
getAvailableVersionsFromManifest,
getDownloadUrl,
getLatestKnownVersion as getLatestVersionInManifest,
REMOTE_MANIFEST_URL,
} from "./version-manifest";
type Release =
Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]["data"][number];
export function tryGetFromToolCache(
arch: Architecture,
version: string,
@@ -58,36 +61,27 @@ export async function downloadVersionFromManifest(
checkSum: string | undefined,
githubToken: string,
): Promise<{ version: string; cachedToolDir: string }> {
// If no user-provided manifest, try remote manifest first (will use cache if already fetched)
// then fall back to bundled manifest
const manifestSources =
manifestUrl !== undefined
? [manifestUrl]
: [REMOTE_MANIFEST_URL, undefined];
for (const source of manifestSources) {
try {
const downloadUrl = await getDownloadUrl(source, version, arch, platform);
if (downloadUrl) {
return await downloadVersion(
downloadUrl,
`uv-${arch}-${platform}`,
platform,
arch,
version,
checkSum,
githubToken,
);
}
} catch (err) {
core.debug(`Failed to get download URL from manifest ${source}: ${err}`);
}
}
core.info(
`Manifest does not contain version ${version}, arch ${arch}, platform ${platform}. Falling back to GitHub releases.`,
const downloadUrl = await getDownloadUrl(
manifestUrl,
version,
arch,
platform,
);
return await downloadVersionFromGithub(
if (!downloadUrl) {
core.info(
`manifest-file does not contain version ${version}, arch ${arch}, platform ${platform}. Falling back to GitHub releases.`,
);
return await downloadVersionFromGithub(
platform,
arch,
version,
checkSum,
githubToken,
);
}
return await downloadVersion(
downloadUrl,
`uv-${arch}-${platform}`,
platform,
arch,
version,
@@ -149,6 +143,7 @@ function getExtension(platform: Platform): string {
export async function resolveVersion(
versionInput: string,
manifestFile: string | undefined,
githubToken: string,
resolutionStrategy: "highest" | "lowest" = "highest",
): Promise<string> {
core.debug(`Resolving version: ${versionInput}`);
@@ -168,7 +163,7 @@ export async function resolveVersion(
} else {
version =
versionInput === "latest" || resolveVersionSpecifierToLatest
? await getLatestVersion()
? await getLatestVersion(githubToken)
: versionInput;
}
if (tc.isExplicitVersion(version)) {
@@ -180,7 +175,7 @@ export async function resolveVersion(
}
return version;
}
const availableVersions = await getAvailableVersions();
const availableVersions = await getAvailableVersions(githubToken);
core.debug(`Available versions: ${availableVersions}`);
const resolvedVersion =
resolutionStrategy === "lowest"
@@ -192,37 +187,79 @@ export async function resolveVersion(
return resolvedVersion;
}
async function getAvailableVersions(): Promise<string[]> {
// 1. Try remote manifest first (no rate limits, always current)
async function getAvailableVersions(githubToken: string): Promise<string[]> {
core.info("Getting available versions from GitHub API...");
try {
core.info("Getting available versions from remote manifest...");
const versions =
await getAvailableVersionsFromManifest(REMOTE_MANIFEST_URL);
core.debug(`Found ${versions.length} versions from remote manifest`);
return versions;
const octokit = new Octokit({
auth: githubToken,
});
return await getReleaseTagNames(octokit);
} catch (err) {
core.debug(`Remote manifest lookup failed: ${err}`);
if ((err as Error).message.includes("Bad credentials")) {
core.info(
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
);
const octokit = new Octokit();
return await getReleaseTagNames(octokit);
}
throw err;
}
// 2. Fall back to bundled manifest (no network, may be stale)
core.info("Getting available versions from bundled manifest...");
return await getAvailableVersionsFromManifest(undefined);
}
async function getLatestVersion() {
// 1. Try remote manifest first (no rate limits, always current)
async function getReleaseTagNames(octokit: Octokit): Promise<string[]> {
const response: Release[] = await octokit.paginate(
octokit.rest.repos.listReleases,
{
owner: OWNER,
repo: REPO,
},
);
const releaseTagNames = response.map((release) => release.tag_name);
if (releaseTagNames.length === 0) {
throw Error(
"Github API request failed while getting releases. Check the GitHub status page for outages. Try again later.",
);
}
return releaseTagNames;
}
async function getLatestVersion(githubToken: string) {
core.info("Getting latest version from GitHub API...");
const octokit = new Octokit({
auth: githubToken,
});
let latestRelease: { tag_name: string } | undefined;
try {
core.info("Getting latest version from remote manifest...");
const version = await getLatestVersionInManifest(REMOTE_MANIFEST_URL);
core.debug(`Latest version from remote manifest: ${version}`);
return version;
latestRelease = await getLatestRelease(octokit);
} catch (err) {
core.debug(`Remote manifest lookup failed: ${err}`);
if ((err as Error).message.includes("Bad credentials")) {
core.info(
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
);
const octokit = new Octokit();
latestRelease = await getLatestRelease(octokit);
} else {
core.error(
"Github API request failed while getting latest release. Check the GitHub status page for outages. Try again later.",
);
throw err;
}
}
// 2. Fall back to bundled manifest (no network, may be stale)
core.info("Getting latest version from bundled manifest...");
return await getLatestVersionInManifest(undefined);
if (!latestRelease) {
throw new Error("Could not determine latest release.");
}
core.debug(`Latest version: ${latestRelease.tag_name}`);
return latestRelease.tag_name;
}
async function getLatestRelease(octokit: Octokit) {
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
owner: OWNER,
repo: REPO,
});
return latestRelease;
}
function maxSatisfying(

View File

@@ -5,11 +5,6 @@ import * as semver from "semver";
import { fetch } from "../utils/fetch";
const localManifestFile = join(__dirname, "..", "..", "version-manifest.json");
export const REMOTE_MANIFEST_URL =
"https://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.json";
// Cache for manifest entries to avoid re-fetching
const manifestCache = new Map<string, ManifestEntry[]>();
interface ManifestEntry {
version: string;
@@ -44,25 +39,9 @@ export async function getDownloadUrl(
return entry ? entry.downloadUrl : undefined;
}
export async function getAvailableVersionsFromManifest(
manifestUrl: string | undefined,
): Promise<string[]> {
const manifestEntries = await getManifestEntries(manifestUrl);
return [...new Set(manifestEntries.map((entry) => entry.version))];
}
async function getManifestEntries(
manifestUrl: string | undefined,
): Promise<ManifestEntry[]> {
const cacheKey = manifestUrl ?? "local";
// Return cached entries if available
const cached = manifestCache.get(cacheKey);
if (cached !== undefined) {
core.debug(`Using cached manifest entries for: ${cacheKey}`);
return cached;
}
let data: string;
if (manifestUrl !== undefined) {
core.info(`Fetching manifest-file from: ${manifestUrl}`);
@@ -79,9 +58,7 @@ async function getManifestEntries(
data = fileContent.toString();
}
const entries: ManifestEntry[] = JSON.parse(data);
manifestCache.set(cacheKey, entries);
return entries;
return JSON.parse(data);
}
export async function updateVersionManifest(

View File

@@ -157,7 +157,12 @@ async function determineVersion(
manifestFile: string | undefined,
): Promise<string> {
if (versionInput !== "") {
return await resolveVersion(versionInput, manifestFile, resolutionStrategy);
return await resolveVersion(
versionInput,
manifestFile,
githubToken,
resolutionStrategy,
);
}
if (versionFileInput !== "") {
const versionFromFile = getUvVersionFromFile(versionFileInput);
@@ -169,6 +174,7 @@ async function determineVersion(
return await resolveVersion(
versionFromFile,
manifestFile,
githubToken,
resolutionStrategy,
);
}
@@ -186,6 +192,7 @@ async function determineVersion(
return await resolveVersion(
versionFromUvToml || versionFromPyproject || "latest",
manifestFile,
githubToken,
resolutionStrategy,
);
}

View File

@@ -1,4 +1,130 @@
[
{
"arch": "aarch64",
"artifactName": "uv-aarch64-apple-darwin.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-aarch64-apple-darwin.tar.gz",
"platform": "apple-darwin",
"version": "0.9.27"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-aarch64-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.27"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-aarch64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-aarch64-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.27"
},
{
"arch": "arm",
"artifactName": "uv-arm-unknown-linux-musleabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-arm-unknown-linux-musleabihf.tar.gz",
"platform": "unknown-linux-musleabihf",
"version": "0.9.27"
},
{
"arch": "armv7",
"artifactName": "uv-armv7-unknown-linux-gnueabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-armv7-unknown-linux-gnueabihf.tar.gz",
"platform": "unknown-linux-gnueabihf",
"version": "0.9.27"
},
{
"arch": "armv7",
"artifactName": "uv-armv7-unknown-linux-musleabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-armv7-unknown-linux-musleabihf.tar.gz",
"platform": "unknown-linux-musleabihf",
"version": "0.9.27"
},
{
"arch": "i686",
"artifactName": "uv-i686-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-i686-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.27"
},
{
"arch": "i686",
"artifactName": "uv-i686-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-i686-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "i686",
"artifactName": "uv-i686-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-i686-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.27"
},
{
"arch": "powerpc64",
"artifactName": "uv-powerpc64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-powerpc64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "powerpc64le",
"artifactName": "uv-powerpc64le-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-powerpc64le-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "riscv64gc",
"artifactName": "uv-riscv64gc-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-riscv64gc-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "s390x",
"artifactName": "uv-s390x-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-s390x-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-apple-darwin.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-x86_64-apple-darwin.tar.gz",
"platform": "apple-darwin",
"version": "0.9.27"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-x86_64-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.27"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-x86_64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.27"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.27/uv-x86_64-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.27"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-apple-darwin.tar.gz",