Extract CRuby releases under $RUNNER_TOOL_CACHE

This commit is contained in:
Benoit Daloze
2020-11-09 13:00:42 +01:00
parent 693cf1794d
commit 933dca770c
5 changed files with 86 additions and 22 deletions
+12
View File
@@ -59,6 +59,18 @@ function findUbuntuVersion() {
}
}
export function shouldExtractInToolCache(engine, version) {
return engine === 'ruby' && !isHeadVersion(version)
}
export function getToolCacheRubyPrefix(version) {
const toolCache = process.env['RUNNER_TOOL_CACHE']
if (!toolCache) {
throw new Error('$RUNNER_TOOL_CACHE must be set')
}
return path.join(toolCache, 'Ruby', version, 'x64')
}
// convert windows path like C:\Users\runneradmin to /c/Users/runneradmin
export function win2nix(path) {
if (/^[A-Z]:/i.test(path)) {