From 5e0cab206a5ea620130caf672fce3e4a6b5666a1 Mon Sep 17 00:00:00 2001 From: luca <681992+lukka@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:21:40 +0100 Subject: [PATCH] consume v4.1.2 for arm default triplet fix --- dist/index.js | 38 ++++++++++++++++++++++------------- package-lock.json | 50 +++++++++++++++++++++++------------------------ package.json | 10 +++++----- 3 files changed, 54 insertions(+), 44 deletions(-) diff --git a/dist/index.js b/dist/index.js index e0c41e47..e2936b00 100644 --- a/dist/index.js +++ b/dist/index.js @@ -44416,25 +44416,35 @@ class BaseUtilLib { this.baseLib.writeFile(file, content); } getDefaultTriplet() { + var _a, _b; const envVar = process.env["VCPKG_DEFAULT_TRIPLET"]; if (envVar) { return envVar; } - else { - if (this.isWin32()) { - return "x64-windows"; - } - else if (this.isLinux()) { - return "x64-linux"; - } - else if (this.isMacos()) { - return "x64-osx"; - } - else if (this.isBSD()) { - return "x64-freebsd"; - } + let arch = null; + // On hosted GitHub runners, the env var RUNNER_ARCH can be 'X86', 'X64', 'ARM' or 'ARM64'. + arch = (_b = (_a = process.env["RUNNER_ARCH"]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : null; + if (!arch) { + // Fallback to os.arch() when running outside of GH runners. + arch = os.arch(); } - return null; + let plat = null; + if (this.isWin32()) { + plat = "windows"; + } + else if (this.isLinux()) { + plat = "linux"; + } + else if (this.isMacos()) { + plat = "osx"; + } + else if (this.isBSD()) { + plat = "freebsd"; + } + if (plat && arch) + return `${arch}-${plat}`; + else + return null; } // Set both the environment variable and the workflow variable with the same name. // The workflow variable might be re-used in subsequent steps. diff --git a/package-lock.json b/package-lock.json index da014a10..a94977fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,11 +15,11 @@ "@actions/github": "6.0.0", "@actions/glob": "^0.4.0", "@actions/io": "^1.1.3", - "@lukka/action-lib": "^4.1.1", - "@lukka/assets-lib": "^4.1.1", - "@lukka/base-lib": "^4.1.1", - "@lukka/base-util-lib": "^4.1.1", - "@lukka/run-vcpkg-lib": "^4.1.1", + "@lukka/action-lib": "^4.1.2", + "@lukka/assets-lib": "^4.1.2", + "@lukka/base-lib": "^4.1.2", + "@lukka/base-util-lib": "^4.1.2", + "@lukka/run-vcpkg-lib": "^4.1.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/jest": "29.5.6", @@ -1434,9 +1434,9 @@ } }, "node_modules/@lukka/action-lib": { - "version": "4.1.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/4.1.1/78208274d33910aadd8eb982ebccc50da6083728", - "integrity": "sha512-HESUq0Io4PQqk1YAM/e/IZfVmTC/UC4Zh+V9aIdPQIFwL2ByKg8YbWLhxg3Sel4i9td5jcTTFuVQW3ZmNnnvXQ==", + "version": "4.1.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/4.1.2/fa9e5eacfa50a4a624e72e6f15bc510e3370b88b", + "integrity": "sha512-+V5GS6hyGFm3RHL34R+ns1MDlTfK+hylt7uyK+ZOqxhvHXvpzjxtbByI6reDScRqXRD5Ly42OjUD+Fu0GWAJaA==", "license": "MIT", "dependencies": { "@actions/core": "1.10.1", @@ -1444,29 +1444,29 @@ "@actions/github": "^6.0.0", "@actions/glob": "0.4.0", "@actions/io": "1.1.3", - "@lukka/base-lib": "^4.1.1", - "@lukka/base-util-lib": "^4.1.1" + "@lukka/base-lib": "^4.1.2", + "@lukka/base-util-lib": "^4.1.2" } }, "node_modules/@lukka/assets-lib": { - "version": "4.1.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/4.1.1/ee5355030f35629c64fabe86ff06d0b66a6167f4", - "integrity": "sha512-ugB6Yc0ZmmnwNtewM0EvxGxSDEzJBtBfVaezBusil3u6ED1Yf6neK87s5lZi7o+smcJz0RZletbEB1mimZdQHQ==", + "version": "4.1.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/4.1.2/8691cb9d6a6cbb135fc2293f32f039eb99ab124e", + "integrity": "sha512-2DND+cFwE0w0WS65hX9VTfLV4R2DAPoA7OtIZVnJNsprKqStattKseBYwgqqLSrNotmk+N48Eoa1RnmQFnKqww==", "license": "MIT" }, "node_modules/@lukka/base-lib": { - "version": "4.1.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/4.1.1/c340a0779dbd0c23164115e5df335f4cacba7866", - "integrity": "sha512-jD83GvX4bve20gcXEVoWnNov9tc2NuLN/Zi+/u9194/WXf8Vqx8NLKFATSE1AtJUyG7cbvw2Fk2BiNb0Eig/tQ==", + "version": "4.1.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/4.1.2/70b0a14de47898cb8bb83603ce4bb55e2c5d9e3d", + "integrity": "sha512-qXIzaoLmdSudOP0pTNeHeDLM2KwnOLJs0B56fDHsjVfMZslNCd8QXac4bp9VHoxCYVY/WtJaj+nUNtYi+ldiQg==", "license": "MIT" }, "node_modules/@lukka/base-util-lib": { - "version": "4.1.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/4.1.1/b683e40b74e4f18fe1327879f208df99332d294b", - "integrity": "sha512-USg9u99V+QqK2vw6wuzl0MyqP5oC0skBATvCMLh18masx/ghR6a8ATiWBCdcOjCYUl9xNKoVAlL/sALaHqMrfQ==", + "version": "4.1.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/4.1.2/876c167f067fecbc47b13ba20e5c6296c3379f97", + "integrity": "sha512-h6CCiFyXr2tkaTEwK5Uo3+9gHQhtllexUiBP3heK3aMbkeBC4C0gmoZA3uBl5bsMchIz/IZcyNqbwcR+4la7Zw==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^4.1.1", + "@lukka/base-lib": "^4.1.2", "del": "^5", "fast-glob": "^3.3.1", "using-statement": "^0.4.2" @@ -1499,13 +1499,13 @@ } }, "node_modules/@lukka/run-vcpkg-lib": { - "version": "4.1.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/4.1.1/1093bc4a46f27214d1aa0ddd78325a563fe7aa0e", - "integrity": "sha512-rjZdqT4PEPYPPyJf139vKiTnxUOldC2Fkrpd40+JSLS5jwBLUHf3xJBOqZ/jeY8Sh1Xh6Lf1SAT1XtRWWx8tpg==", + "version": "4.1.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/4.1.2/425066fbe7c1e04d17c1441fe49bfbcd7cd77dd4", + "integrity": "sha512-rLETeYB/ublZw4yInFN/mmnBIfwmabZ6dCN+8Rsn40CDvf1DGUGViWi1ny1HyuUruGVghJsvURtpTZ3onR7b7g==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^4.1.1", - "@lukka/base-util-lib": "^4.1.1", + "@lukka/base-lib": "^4.1.2", + "@lukka/base-util-lib": "^4.1.2", "fast-glob": "^3.3.2", "jsonpath": "^1.1.1", "using-statement": "^0.4.2" diff --git a/package.json b/package.json index 35a9f2ba..c04e76c3 100644 --- a/package.json +++ b/package.json @@ -40,11 +40,11 @@ "@actions/github": "6.0.0", "@actions/glob": "^0.4.0", "@actions/io": "^1.1.3", - "@lukka/action-lib": "^4.1.1", - "@lukka/assets-lib": "^4.1.1", - "@lukka/base-lib": "^4.1.1", - "@lukka/base-util-lib": "^4.1.1", - "@lukka/run-vcpkg-lib": "^4.1.1", + "@lukka/action-lib": "^4.1.2", + "@lukka/assets-lib": "^4.1.2", + "@lukka/base-lib": "^4.1.2", + "@lukka/base-util-lib": "^4.1.2", + "@lukka/run-vcpkg-lib": "^4.1.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/jest": "29.5.6",