mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-06-10 06:32:58 +00:00
feat: add download-from-astral-mirror input (#897)
## Summary Add a new boolean input `download-from-astral-mirror` (default: `true`) that controls whether uv is downloaded from the Astral mirror or directly from GitHub Releases. When set to `false`, the mirror rewrite is skipped entirely and the download goes straight to GitHub Releases. Closes: #870
This commit is contained in:
committed by
GitHub
parent
80cc27528e
commit
b9c8c4c7ba
@@ -376,6 +376,32 @@ describe("download-version", () => {
|
||||
"0.9.26",
|
||||
);
|
||||
});
|
||||
|
||||
it("skips the Astral mirror when downloadFromAstralMirror is false", async () => {
|
||||
mockGetArtifact.mockResolvedValue({
|
||||
archiveFormat: "tar.gz",
|
||||
checksum: "abc123",
|
||||
downloadUrl:
|
||||
"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz",
|
||||
});
|
||||
|
||||
await downloadVersion(
|
||||
"unknown-linux-gnu",
|
||||
"x86_64",
|
||||
"0.9.26",
|
||||
undefined,
|
||||
"token",
|
||||
undefined,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(mockDownloadTool).toHaveBeenCalledWith(
|
||||
"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz",
|
||||
undefined,
|
||||
"token",
|
||||
);
|
||||
expect(mockDownloadTool).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("rewriteToMirror", () => {
|
||||
|
||||
Reference in New Issue
Block a user