From 553a648212e47f5245e7f99be84325172e117551 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 7 Jan 2025 01:42:09 -0800 Subject: [PATCH] refactor: use GitHub downloads for stable version download (#91) (cherry picked from commit 5e036d05d88737dd41a36190ff53eb98154aa96e) --- src/install.mjs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/install.mjs b/src/install.mjs index 4924534..0a80580 100644 --- a/src/install.mjs +++ b/src/install.mjs @@ -20,9 +20,20 @@ export async function install(version) { } const zip = zipName(); - const url = version.kind === "canary" - ? `https://dl.deno.land/canary/${version.version}/${zip}` - : `https://dl.deno.land/release/v${version.version}/${zip}`; + let url; + + switch (version.kind) { + case "canary": + url = `https://dl.deno.land/canary/${version.version}/${zip}`; + break; + case "rc": + url = `https://dl.deno.land/release/v${version.version}/${zip}`; + break; + case "stable": + url = + `https://github.com/denoland/deno/releases/download/v${version.version}/${zip}`; + break; + } core.info(`Downloading Deno from ${url}.`);