Add option to skip Astral mirror downloads (#387)

## Summary
- add `download-from-astral-mirror` input defaulting to `true`
- skip mirror URL rewriting and download directly from GitHub Releases
when disabled
- document the input and add unit coverage

Fixes #384

Refs: pi-session 019f31bc-bd1c-7276-9b4e-9734fa0aa367

## Testing
- npm run build
- npm run check
- npm run test:unit
This commit is contained in:
Kevin Stillhammer
2026-07-05 10:17:44 +00:00
committed by GitHub
parent c35f46c92b
commit 278981a28c
7 changed files with 103 additions and 12 deletions
+10 -1
View File
@@ -9,6 +9,7 @@ import {
import {
args,
checkSum,
downloadFromAstralMirror,
githubToken,
manifestFile,
src,
@@ -39,7 +40,13 @@ async function run(): Promise<void> {
if (arch === undefined) {
throw new Error(`Unsupported architecture: ${process.arch}`);
}
const setupResult = await setupRuff(platform, arch, checkSum, githubToken);
const setupResult = await setupRuff(
platform,
arch,
checkSum,
githubToken,
downloadFromAstralMirror,
);
addRuffToPath(setupResult.ruffDir);
setOutputFormat();
@@ -60,6 +67,7 @@ async function setupRuff(
arch: Architecture,
checkSum: string | undefined,
githubToken: string,
downloadFromAstralMirror: boolean,
): Promise<{ ruffDir: string; version: string }> {
const resolvedVersion = await determineVersion();
const manifestUrl = manifestFile || undefined;
@@ -84,6 +92,7 @@ async function setupRuff(
checkSum,
githubToken,
manifestUrl,
downloadFromAstralMirror,
);
return {