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

Add GraalPy support #694

Merged
merged 18 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Build
  • Loading branch information
msimacek committed Aug 30, 2023
commit 5b60f8c31d073e52c0b119c607c0602e899733ed
52 changes: 30 additions & 22 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69584,7 +69584,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.findAsset = exports.findRelease = exports.graalPyTagToVersion = exports.getAvailableGraalPyVersions = exports.installGraalPy = void 0;
exports.findAsset = exports.toGraalPyArchitecture = exports.toGraalPyPlatform = exports.findRelease = exports.graalPyTagToVersion = exports.getAvailableGraalPyVersions = exports.installGraalPy = void 0;
const os = __importStar(__nccwpck_require__(2037));
const path = __importStar(__nccwpck_require__(1017));
const core = __importStar(__nccwpck_require__(2186));
Expand Down Expand Up @@ -69727,28 +69727,36 @@ function findRelease(releases, graalpyVersion, architecture, includePrerelease)
};
}
exports.findRelease = findRelease;
function findAsset(item, architecture, platform) {
const graalpyArch = architecture === 'x64'
? 'amd64'
: architecture === 'arm64'
? 'aarch64'
: architecture;
const graalpyPlatform = platform === 'win32'
? 'windows'
: platform === 'darwin'
? 'macos'
: platform;
if (item.assets.length) {
return item.assets.find((file) => {
const match_data = file.name.match('.*(macos|linux|windows)-(amd64|aarch64).tar.gz$');
return (match_data &&
match_data[1] === graalpyPlatform &&
match_data[2] === graalpyArch);
});
}
else {
return undefined;
function toGraalPyPlatform(platform) {
switch (platform) {
case 'win32':
return 'windows';
case 'darwin':
return 'macos';
}
return platform;
}
exports.toGraalPyPlatform = toGraalPyPlatform;
function toGraalPyArchitecture(architecture) {
switch (architecture) {
case 'x64':
return 'amd64';
case 'arm64':
return 'aarch64';
}
return architecture;
}
exports.toGraalPyArchitecture = toGraalPyArchitecture;
function findAsset(item, architecture, platform) {
const graalpyArch = toGraalPyArchitecture(architecture);
const graalpyPlatform = toGraalPyPlatform(platform);
const found = item.assets.filter(file => file.name.startsWith('graalpy') &&
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.tar.gz`));
/*
In the future there could be more variants of GraalPy for a single release. Pick the shortest name, that one is the most likely to be the primary variant.
*/
found.sort((f1, f2) => f1.name.length - f2.name.length);
return found[0];
}
exports.findAsset = findAsset;

Expand Down