Merge pull request #76 from aminya/windows-unzip [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-05-09 17:40:22 -07:00 committed by GitHub
commit 4b6411c5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 34 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
lockfileVersion: 5.3
lockfileVersion: 5.4
overrides:
semver: 7.3.7
@ -85,7 +85,7 @@ devDependencies:
prettier-config-atomic: 3.0.9
shx: 0.3.4
terser-config-atomic: 0.1.1
ts-jest: 28.0.1_4db907953e67367985ae85b48dfb7df7
ts-jest: 28.0.1_jw4qpfj6m43htbnoqw2i363564
typescript: 4.6.4
packages:
@ -309,7 +309,7 @@ packages:
- supports-color
dev: true
/@babel/eslint-parser/7.17.0_7449dd49ffed0eea046851524f1e657b:
/@babel/eslint-parser/7.17.0_ore52sp75uhoubdikfje6htfpm:
resolution: {integrity: sha512-PUEJ7ZBXbRkbq3qqM/jZ2nIuakUBqCYc7Qf52Lj7dlZ6zERnqisdHioL0l4wwQZnmskMeasqUNzLBFKs3nylXA==}
engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0}
peerDependencies:
@ -2212,7 +2212,7 @@ packages:
'@types/yargs-parser': 21.0.0
dev: true
/@typescript-eslint/eslint-plugin/5.22.0_5b52bb1e77494a9627aef8db6adb10bc:
/@typescript-eslint/eslint-plugin/5.22.0_lnjlwhtxjffjmj5o7dnwvwyqxq:
resolution: {integrity: sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -2223,10 +2223,10 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/parser': 5.22.0_t725usgvqspm5woeqpaxbfp2qu
'@typescript-eslint/scope-manager': 5.22.0
'@typescript-eslint/type-utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/type-utils': 5.22.0_t725usgvqspm5woeqpaxbfp2qu
'@typescript-eslint/utils': 5.22.0_t725usgvqspm5woeqpaxbfp2qu
debug: 4.3.4
eslint: 8.14.0
functional-red-black-tree: 1.0.1
@ -2239,7 +2239,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/parser/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/parser/5.22.0_t725usgvqspm5woeqpaxbfp2qu:
resolution: {integrity: sha512-piwC4krUpRDqPaPbFaycN70KCP87+PC5WZmrWs+DlVOxxmF+zI6b6hETv7Quy4s9wbkV16ikMeZgXsvzwI3icQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -2267,7 +2267,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.22.0
dev: true
/@typescript-eslint/type-utils/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/type-utils/5.22.0_t725usgvqspm5woeqpaxbfp2qu:
resolution: {integrity: sha512-iqfLZIsZhK2OEJ4cQ01xOq3NaCuG5FQRKyHicA3xhZxMgaxQazLUHbH/B2k9y5i7l3+o+B5ND9Mf1AWETeMISA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -2277,7 +2277,7 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/utils': 5.22.0_t725usgvqspm5woeqpaxbfp2qu
debug: 4.3.4
eslint: 8.14.0
tsutils: 3.21.0_typescript@4.6.4
@ -2312,7 +2312,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/utils/5.22.0_t725usgvqspm5woeqpaxbfp2qu:
resolution: {integrity: sha512-HodsGb037iobrWSUMS7QH6Hl1kppikjA1ELiJlNSTYf/UdMEwzgj0WIp+lBNb6WZ3zTwb0tEz51j0Wee3iJ3wQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -3603,7 +3603,7 @@ packages:
engines: {node: '>=10'}
dev: true
/eslint-config-airbnb-base/14.2.1_662e1b2e8ef3f6aa5d22c3f7cd670612:
/eslint-config-airbnb-base/14.2.1_myxbwluo6p3kuxjcyp342zygci:
resolution: {integrity: sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==}
engines: {node: '>= 6'}
peerDependencies:
@ -3618,7 +3618,7 @@ packages:
dev: true
optional: true
/eslint-config-airbnb/18.2.1_f59bbcee69361c545d044fb4451710cb:
/eslint-config-airbnb/18.2.1_6wn3z3tjgyofixiej62ekfyqzm:
resolution: {integrity: sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==}
engines: {node: '>= 6'}
peerDependencies:
@ -3629,7 +3629,7 @@ packages:
eslint-plugin-react-hooks: ^4 || ^3 || ^2.3.0 || ^1.7.0
dependencies:
eslint: 8.14.0
eslint-config-airbnb-base: 14.2.1_662e1b2e8ef3f6aa5d22c3f7cd670612
eslint-config-airbnb-base: 14.2.1_myxbwluo6p3kuxjcyp342zygci
eslint-plugin-import: 2.26.0_eslint@8.14.0
eslint-plugin-jsx-a11y: 6.5.1_eslint@8.14.0
eslint-plugin-react: 7.23.2_eslint@8.14.0
@ -3643,11 +3643,11 @@ packages:
resolution: {integrity: sha512-LFytMqabif4bB59bV8s3pc1gN/UNzRY53l5F8mzZQLKmSETXQ2UDTEJ62l8xyQocMsDcaCaY5ALNmJqBngIAFQ==}
dependencies:
'@babel/core': 7.17.10
'@babel/eslint-parser': 7.17.0_7449dd49ffed0eea046851524f1e657b
'@babel/eslint-parser': 7.17.0_ore52sp75uhoubdikfje6htfpm
'@babel/plugin-syntax-flow': 7.16.7_@babel+core@7.17.10
'@babel/plugin-syntax-jsx': 7.16.7_@babel+core@7.17.10
'@typescript-eslint/eslint-plugin': 5.22.0_5b52bb1e77494a9627aef8db6adb10bc
'@typescript-eslint/parser': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/eslint-plugin': 5.22.0_lnjlwhtxjffjmj5o7dnwvwyqxq
'@typescript-eslint/parser': 5.22.0_t725usgvqspm5woeqpaxbfp2qu
eslint: 8.14.0
eslint-config-prettier: 8.5.0_eslint@8.14.0
eslint-plugin-html: 6.2.0
@ -3663,7 +3663,7 @@ packages:
typescript: 4.6.4
optionalDependencies:
coffeescript: 1.12.7
eslint-plugin-coffee: 0.1.15_c6af0447cbddeabec3406108d97c6f86
eslint-plugin-coffee: 0.1.15_y2xqir6l3xvl5q2ameens7dpqy
eslint-plugin-react-hooks: 4.5.0_eslint@8.14.0
transitivePeerDependencies:
- supports-color
@ -3693,20 +3693,20 @@ packages:
find-up: 2.1.0
dev: true
/eslint-plugin-coffee/0.1.15_c6af0447cbddeabec3406108d97c6f86:
/eslint-plugin-coffee/0.1.15_y2xqir6l3xvl5q2ameens7dpqy:
resolution: {integrity: sha512-+qtkIPSc9etYqOODIlENqiRjID/oEoGMAAQJN988Aczy461NIwzaamFY6Fi0QDVVDb2v+OL/StVrk/QmyItfeg==}
requiresBuild: true
peerDependencies:
eslint: '*'
dependencies:
axe-core: 3.5.6
babel-eslint: /@babel/eslint-parser/7.17.0_7449dd49ffed0eea046851524f1e657b
babel-eslint: /@babel/eslint-parser/7.17.0_ore52sp75uhoubdikfje6htfpm
babylon: 7.0.0-beta.47
coffeescript: 2.7.0
doctrine: 2.1.0
eslint: 8.14.0
eslint-config-airbnb: 18.2.1_f59bbcee69361c545d044fb4451710cb
eslint-config-airbnb-base: 14.2.1_662e1b2e8ef3f6aa5d22c3f7cd670612
eslint-config-airbnb: 18.2.1_6wn3z3tjgyofixiej62ekfyqzm
eslint-config-airbnb-base: 14.2.1_myxbwluo6p3kuxjcyp342zygci
eslint-plugin-import: 2.26.0_eslint@8.14.0
eslint-plugin-jsx-a11y: 6.5.1_eslint@8.14.0
eslint-plugin-react: 7.23.2_eslint@8.14.0
@ -7618,7 +7618,7 @@ packages:
punycode: 2.1.1
dev: true
/ts-jest/28.0.1_4db907953e67367985ae85b48dfb7df7:
/ts-jest/28.0.1_jw4qpfj6m43htbnoqw2i363564:
resolution: {integrity: sha512-PbkbitaT/9ZYAqqzk3UYTvCq080Seo46T3m/AdwcZ0D8WH2uBhG6PvA8oOAWsZIknzPQU66fYobvFCL8IqIhmg==}
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
hasBin: true

View File

@ -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 {

View File

@ -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)

View File

@ -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 */

View File

@ -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 */

View File

@ -3,12 +3,18 @@ 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)
@ -16,9 +22,17 @@ export async function extractExe(file: string, dest: string) {
// 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"]) {