diff --git a/dist/index.cjs b/dist/index.cjs index 0da42060..b3b410df 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -151431,19 +151431,24 @@ async function getCygwinVersion() { const response = await httpClient.get("https://www.cygwin.com"); const body = await response.readBody(); const $2 = load(body); - let version = ""; + let version = null; $2("a").each((_index, element) => { const text3 = $2(element).text(); if (semver3.valid(text3) === text3) { version = text3; } }); - return version; + if (version !== null) { + return version; + } else { + core4.info("Cygwin homepage:"); + core4.info(body); + throw new Error("Couldn't parse Cygwin version from homepage"); + } } async function setupCygwin() { await core4.group("Setting up Cygwin environment", async () => { - const version = await getCygwinVersion(); - const cachedPath = toolCache2.find("cygwin", version, "x86_64"); + const cachedPath = toolCache2.find("cygwin", "latest", "x86_64"); if (cachedPath === "") { const downloadedPath = await toolCache2.downloadTool( "https://cygwin.com/setup-x86_64.exe" @@ -151452,7 +151457,7 @@ async function setupCygwin() { downloadedPath, "setup-x86_64.exe", "cygwin", - version, + "latest", "x86_64" ); core4.addPath(cachedPath2); diff --git a/packages/setup-ocaml/src/windows.ts b/packages/setup-ocaml/src/windows.ts index 2fb10719..6cac1dd9 100644 --- a/packages/setup-ocaml/src/windows.ts +++ b/packages/setup-ocaml/src/windows.ts @@ -26,20 +26,25 @@ export async function getCygwinVersion() { const response = await httpClient.get("https://www.cygwin.com"); const body = await response.readBody(); const $ = cheerio.load(body); - let version = ""; + let version = null; $("a").each((_index, element) => { const text = $(element).text(); if (semver.valid(text) === text) { version = text; } }); - return version; + if (version !== null) { + return version; + } else { + core.info("Cygwin homepage:"); + core.info(body); + throw new Error("Couldn't parse Cygwin version from homepage"); + } } export async function setupCygwin() { await core.group("Setting up Cygwin environment", async () => { - const version = await getCygwinVersion(); - const cachedPath = toolCache.find("cygwin", version, "x86_64"); + const cachedPath = toolCache.find("cygwin", "latest", "x86_64"); if (cachedPath === "") { const downloadedPath = await toolCache.downloadTool( "https://cygwin.com/setup-x86_64.exe", @@ -48,7 +53,7 @@ export async function setupCygwin() { downloadedPath, "setup-x86_64.exe", "cygwin", - version, + "latest", "x86_64", ); core.addPath(cachedPath);