Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Mirror Support for Planned lua.org Outages #47 #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,16 @@ async function install_plain_lua(luaInstallPath, luaVersion) {
const luaExtractPath = pathJoin(process.env["RUNNER_TEMP"], BUILD_PREFIX, `lua-${luaVersion}`)
const luaCompileFlags = core.getInput('luaCompileFlags')

const luaSourceTar = await tc.downloadTool(`https://lua.org/ftp/lua-${luaVersion}.tar.gz`)
const primaryUrl = `https://lua.org/ftp/lua-${luaVersion}.tar.gz`
const mirrorUrl = `https://www.tecgraf.puc-rio.br/lua/mirror/ftp/lua-${luaVersion}.tar.gz`
let luaSourceTar

const primaryDownload = tc.downloadTool(primaryUrl)
const mirrorDownload = tc.downloadTool(mirrorUrl)

luaSourceTar = await Promise.race([primaryDownload, mirrorDownload]).catch(async (error) => {
throw new Error(`Failed to download Lua source: ${error}`)
})
await io.mkdirP(luaExtractPath)
await tc.extractTar(luaSourceTar, path.join(process.env["RUNNER_TEMP"], BUILD_PREFIX))

Expand Down