mirror of
https://github.com/actions/setup-java.git
synced 2026-07-08 14:21:50 +00:00
Added pre-push changes
This commit is contained in:
parent
e514774d14
commit
1dc95d11b7
47
dist/setup/index.js
vendored
47
dist/setup/index.js
vendored
@ -79932,6 +79932,7 @@ const core = __importStar(__nccwpck_require__(37484));
|
|||||||
const tc = __importStar(__nccwpck_require__(33472));
|
const tc = __importStar(__nccwpck_require__(33472));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(16928));
|
const path_1 = __importDefault(__nccwpck_require__(16928));
|
||||||
|
const semver_1 = __importDefault(__nccwpck_require__(62088));
|
||||||
var microsoft_key_2 = __nccwpck_require__(56286);
|
var microsoft_key_2 = __nccwpck_require__(56286);
|
||||||
Object.defineProperty(exports, "MICROSOFT_PUBLIC_KEY", ({ enumerable: true, get: function () { return microsoft_key_2.MICROSOFT_PUBLIC_KEY; } }));
|
Object.defineProperty(exports, "MICROSOFT_PUBLIC_KEY", ({ enumerable: true, get: function () { return microsoft_key_2.MICROSOFT_PUBLIC_KEY; } }));
|
||||||
class MicrosoftDistributions extends base_installer_1.JavaBase {
|
class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||||
@ -79984,7 +79985,21 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
|||||||
if (!manifest) {
|
if (!manifest) {
|
||||||
throw new Error('Could not load manifest for Microsoft Build of OpenJDK');
|
throw new Error('Could not load manifest for Microsoft Build of OpenJDK');
|
||||||
}
|
}
|
||||||
const foundRelease = yield tc.findFromManifest(range, true, manifest, arch);
|
let foundRelease;
|
||||||
|
if (this.isRunningOnAlpine() && this.isAlpineSupportedVersion(range)) {
|
||||||
|
foundRelease = this.findFromManifestForPlatform(range, manifest, arch, 'alpine');
|
||||||
|
if (foundRelease) {
|
||||||
|
core.debug(`Resolved Alpine package for Microsoft OpenJDK ${range}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.isRunningOnAlpine()) {
|
||||||
|
core.debug(`No Alpine package found for Microsoft OpenJDK ${range}, defaulting to standard linux package`);
|
||||||
|
}
|
||||||
|
// Runs if user is not running on alpine, or if no Alpine package was found
|
||||||
|
if (!foundRelease) {
|
||||||
|
foundRelease = yield tc.findFromManifest(range, true, manifest, arch);
|
||||||
|
}
|
||||||
|
// Runs if failed to find any matching package
|
||||||
if (!foundRelease) {
|
if (!foundRelease) {
|
||||||
const availableVersionStrings = manifest.map(item => item.version);
|
const availableVersionStrings = manifest.map(item => item.version);
|
||||||
throw this.createVersionNotFoundError(range, availableVersionStrings);
|
throw this.createVersionNotFoundError(range, availableVersionStrings);
|
||||||
@ -79998,17 +80013,37 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
findFromManifestForPlatform(range, manifest, arch, platform) {
|
||||||
|
const matched = manifest
|
||||||
|
.filter(release => release.stable)
|
||||||
|
.filter(release => (0, util_1.isVersionSatisfies)(range, release.version))
|
||||||
|
.map(release => {
|
||||||
|
const matchedFile = release.files.find((file) => file.arch === arch && file.platform === platform);
|
||||||
|
if (!matchedFile) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Object.assign(Object.assign({}, release), { files: [matchedFile] });
|
||||||
|
})
|
||||||
|
.filter((release) => release !== null)
|
||||||
|
.sort((a, b) => -semver_1.default.compareBuild(a.version, b.version));
|
||||||
|
return matched[0];
|
||||||
|
}
|
||||||
|
isAlpineSupportedVersion(range) {
|
||||||
|
const minVersion = semver_1.default.minVersion(range);
|
||||||
|
return !!minVersion && (minVersion.major === 11 || minVersion.major === 17);
|
||||||
|
}
|
||||||
|
isRunningOnAlpine() {
|
||||||
|
return process.platform === 'linux' && fs_1.default.existsSync('/etc/alpine-release');
|
||||||
|
}
|
||||||
supportsSignatureVerification() {
|
supportsSignatureVerification() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
getAvailableVersions() {
|
getAvailableVersions() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// TODO get these dynamically!
|
const owner = 'microsoft';
|
||||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
const repository = 'openjdk-adoptium-marketplace-data';
|
||||||
const owner = 'actions';
|
|
||||||
const repository = 'setup-java';
|
|
||||||
const branch = 'main';
|
const branch = 'main';
|
||||||
const filePath = 'src/distributions/microsoft/microsoft-openjdk-versions.json';
|
const filePath = 'general_info/microsoft-openjdk-versions.json';
|
||||||
let releases = null;
|
let releases = null;
|
||||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||||
const headers = (0, util_1.getGitHubHttpHeaders)();
|
const headers = (0, util_1.getGitHubHttpHeaders)();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user