Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dist/setup_cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/setup_cpp.js.map

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/cmake/cmake.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { extractZip, extractTar } from "@actions/tool-cache"
import { extractTar } from "@actions/tool-cache"
import semverLte from "semver/functions/lte"
import semverCoerce from "semver/functions/coerce"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { addBinExtension } from "../utils/extension/extension"
import { extractZip } from "../utils/setup/extract"

/** Get the platform data for cmake */
function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {
Expand Down
1 change: 1 addition & 0 deletions src/doxygen/doxygen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
try {
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
setupAptPack("libclang-cpp9")
} catch (err) {
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
installationInfo = setupAptPack("doxygen", undefined)
Expand Down
2 changes: 1 addition & 1 deletion src/ninja/ninja.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extractZip } from "@actions/tool-cache"
import { addBinExtension } from "../utils/extension/extension"
import { extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"

/** Get the platform name Ninja uses in their download links */
Expand Down
3 changes: 1 addition & 2 deletions src/task/task.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { extractZip } from "@actions/tool-cache"
import { addBinExtension } from "../utils/extension/extension"
import { extractTarByExe } from "../utils/setup/extract"
import { extractTarByExe, extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"

/** Get the platform name task uses in their download links */
Expand Down
24 changes: 19 additions & 5 deletions src/utils/setup/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,36 @@ import { mkdirP } from "@actions/io"
import which from "which"
import { setupSevenZip } from "../../sevenzip/sevenzip"
import { warning } from "../io/io"
export { extractTar, extractXar, extract7z, extractZip } from "@actions/tool-cache"
export { extractTar, extractXar } from "@actions/tool-cache"

let sevenZip: string | undefined

export async function extractExe(file: string, dest: string) {
// install 7z if needed
/// Extract 7z using 7z
export async function extract7Zip(file: string, dest: string) {
await execa(await getSevenZip(), ["x", file, `-o${dest}`], { stdio: "inherit" })
return dest
}

/// install 7z if needed
async function getSevenZip() {
if (sevenZip === undefined) {
if (which.sync("7z", { nothrow: true }) === null) {
await setupSevenZip("", "", process.arch)
}
// eslint-disable-next-line require-atomic-updates
sevenZip = "7z"
}
return sevenZip
}

await execa(sevenZip, ["x", file, `-o${dest}`], { stdio: "inherit" })
return dest
/// Extract Exe using 7z
export async function extractExe(file: string, dest: string) {
return extract7Zip(file, dest)
}

/// Extract Zip using 7z
export async function extractZip(file: string, dest: string) {
return extract7Zip(file, dest)
}

export async function extractTarByExe(file: string, dest: string, flags = ["--strip-components=0"]) {
Expand Down