minor changes

This commit is contained in:
Dmitry Shibanov 2022-09-05 15:25:05 +02:00
parent 7b84a4c0bd
commit 1ba38a2e76
3 changed files with 16 additions and 16 deletions

8
dist/setup/index.js vendored
View file

@ -102435,7 +102435,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
if (!availableVersionsRaw) {
throw new Error('Could not load manifest for Microsoft Build of OpenJDK');
}
const foundRelease = yield tc.findFromManifest(range, true, availableVersionsRaw.map(item => Object.assign(item, { release_url: '' })), this.architecture);
const foundRelease = yield tc.findFromManifest(range, true, availableVersionsRaw, this.architecture);
// const opts = this.getPlatformOption();
// const availableVersions = availableVersionsRaw.map(item => ({
// url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version.join('.')}-${opts.os}-${
@ -102468,10 +102468,8 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
// TODO get these dynamically!
// We will need Microsoft to add an endpoint where we can query for versions.
const token = core.getInput('token');
const { result, statusCode } = (yield this.http.getJson('https://github.com/dmitry-shibanov/setup-java/blob/add-json-for-microsoft-versions/microsoft-build-of-openjdk-versions.json', { authorization: token }));
core.info(result);
core.info(statusCode.toString());
return result;
const manifest = yield tc.getManifestFromRepo('dmitry-shibanov', 'setup-java', token, 'add-json-for-microsoft-versions');
return manifest;
});
}
getPlatformOption(platform = process.platform /* for testing */) {

View file

@ -2,6 +2,7 @@
{
"version": "17.0.3",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-17.0.3-macos-x64.tar.gz",
@ -38,6 +39,7 @@
{
"version": "17.0.1+12.1",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
@ -74,6 +76,7 @@
{
"version": "16.0.2+7.1",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-16.0.2+7.1-macos-x64.tar.gz",
@ -110,6 +113,7 @@
{
"version": "11.0.15",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
@ -146,6 +150,7 @@
{
"version": "11.0.13+8.1",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-11.0.13+8.1-macos-x64.tar.gz",

View file

@ -63,7 +63,7 @@ export class MicrosoftDistributions extends JavaBase {
const foundRelease = await tc.findFromManifest(
range,
true,
availableVersionsRaw.map(item => Object.assign(item, { release_url: '' })),
availableVersionsRaw,
this.architecture
);
@ -100,21 +100,18 @@ export class MicrosoftDistributions extends JavaBase {
return { url: foundRelease.release_url, version: foundRelease.version };
}
private async getAvailableVersions(): Promise<IToolRelease[] | null> {
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
// TODO get these dynamically!
// We will need Microsoft to add an endpoint where we can query for versions.
const token = core.getInput('token');
const {result, statusCode} = (
await this.http.getJson<any>(
'https://github.com/dmitry-shibanov/setup-java/blob/add-json-for-microsoft-versions/microsoft-build-of-openjdk-versions.json',
{ authorization: token }
)
const manifest = await tc.getManifestFromRepo(
'dmitry-shibanov',
'setup-java',
token,
'add-json-for-microsoft-versions'
);
core.info(result);
core.info(statusCode.toString());
return result;
return manifest;
}
private getPlatformOption(