fix
All checks were successful
Check Transpiled JavaScript / Check dist/ (push) Successful in 1m1s
Continuous Integration / TypeScript Tests (push) Successful in 1m9s
Continuous Integration / GitHub Actions Test (push) Successful in 7m55s

This commit is contained in:
2024-11-17 12:29:45 +13:00
parent 159a17c5c7
commit 1b84eb59f6
4 changed files with 47 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import * as tc from '@actions/tool-cache'
import * as core from '@actions/core'
import * as httpm from '@actions/http-client'
import * as exec from '@actions/exec'
import { GitHubRelease } from './github-release'
/**
@@ -39,12 +40,32 @@ export async function download(version: string): Promise<string> {
core.info(`Extracting Clang archive...`)
const extractedPath = await tc.extractTar(
archivePath,
undefined,
'-x --strip-components=1'
let exit = await exec.exec('mkdir', ['-p', `/tmp/clang-${version}`])
if (exit !== 0) {
throw new Error(`Failed to create directory /tmp/clang-${version}`)
}
exit = await exec.exec('tar', [
'-x',
'--strip-components=1',
'--warning=no-unknown-keyword',
'--overwrite',
'-C',
`/tmp/clang-${version}`,
'-f',
archivePath
])
if (exit !== 0) {
throw new Error(`Failed to extract clang`)
}
const cachedPath = await tc.cacheDir(
`/tmp/clang-${version}`,
'clang',
version
)
const cachedPath = await tc.cacheDir(extractedPath, 'clang', version)
return cachedPath
}