mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
add property
This commit is contained in:
parent
f25607f348
commit
afb8d2e48a
1 changed files with 10 additions and 5 deletions
|
@ -1,13 +1,18 @@
|
||||||
import { JavaBase } from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
import semver from 'semver';
|
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
|
||||||
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { MicrosoftVersion, PlatformOptions } from './models';
|
import { MicrosoftVersion, PlatformOptions } from './models';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
export interface IToolRelease {
|
||||||
|
version: string;
|
||||||
|
stable: boolean;
|
||||||
|
files: tc.IToolReleaseFile[];
|
||||||
|
}
|
||||||
|
|
||||||
export class MicrosoftDistributions extends JavaBase {
|
export class MicrosoftDistributions extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
super('Microsoft', installerOptions);
|
super('Microsoft', installerOptions);
|
||||||
|
@ -58,7 +63,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
const foundRelease = await tc.findFromManifest(
|
const foundRelease = await tc.findFromManifest(
|
||||||
range,
|
range,
|
||||||
true,
|
true,
|
||||||
availableVersionsRaw,
|
availableVersionsRaw.map(item => Object.assign(item, { release_url: '' })),
|
||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -95,12 +100,12 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
return { url: foundRelease.release_url, version: foundRelease.version };
|
return { url: foundRelease.release_url, version: foundRelease.version };
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
|
private async getAvailableVersions(): Promise<IToolRelease[] | null> {
|
||||||
// TODO get these dynamically!
|
// TODO get these dynamically!
|
||||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
const manifest = (
|
const manifest = (
|
||||||
await this.http.getJson<tc.IToolRelease[]>(
|
await this.http.getJson<IToolRelease[]>(
|
||||||
'https://github.com/dmitry-shibanov/setup-java/blob/add-json-for-microsoft-versions/microsoft-build-of-openjdk-versions.json',
|
'https://github.com/dmitry-shibanov/setup-java/blob/add-json-for-microsoft-versions/microsoft-build-of-openjdk-versions.json',
|
||||||
{ authorization: token }
|
{ authorization: token }
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue