Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default vcpkg triplet for ARM based GH runners #218

Merged
merged 2 commits into from
Feb 10, 2024
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
# (and vcpkg does not run).
- name: Setup anew (or from cache) vcpkg (and does not build any package)
uses: lukka/run-vcpkg@v11 # Always specify the specific _version_ of the
# action you need, `v10` in this case to stay up
# action you need, `v11` in this case to stay up
# to date with fixes on the v11 branch.
#with:
# This is the default location of the directory containing vcpkg sources.
Expand Down
38 changes: 24 additions & 14 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
50 changes: 25 additions & 25 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading