mirror of
https://gitea.com/actions/setup-java.git
synced 2025-04-06 15:29:37 +00:00
Fix typo (#380)
This commit is contained in:
@ -116,7 +116,7 @@ export async function save(id: string) {
|
||||
const packageManager = findPackageManager(id);
|
||||
const matchedKey = core.getState(CACHE_MATCHED_KEY);
|
||||
|
||||
// Inputs are re-evaluted before the post action, so we want the original key used for restore
|
||||
// Inputs are re-evaluated before the post action, so we want the original key used for restore
|
||||
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
|
||||
|
||||
if (!primaryKey) {
|
||||
|
@ -142,12 +142,12 @@ export abstract class JavaBase {
|
||||
}
|
||||
|
||||
protected setJavaDefault(version: string, toolPath: string) {
|
||||
const majorVerssion = version.split('.')[0];
|
||||
const majorVersion = version.split('.')[0];
|
||||
core.exportVariable('JAVA_HOME', toolPath);
|
||||
core.addPath(path.join(toolPath, 'bin'));
|
||||
core.setOutput('distribution', this.distribution);
|
||||
core.setOutput('path', toolPath);
|
||||
core.setOutput('version', version);
|
||||
core.exportVariable(`JAVA_HOME_${majorVerssion}_${this.architecture.toUpperCase()}`, toolPath);
|
||||
core.exportVariable(`JAVA_HOME_${majorVersion}_${this.architecture.toUpperCase()}`, toolPath);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import path from 'path';
|
||||
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
|
||||
import { JavaBase } from '../base-installer';
|
||||
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||
import { ICorrettoAllAvailableVersions, ICorettoAvailableVersions } from './models';
|
||||
import { ICorrettoAllAvailableVersions, ICorrettoAvailableVersions } from './models';
|
||||
|
||||
export class CorrettoDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
@ -66,13 +66,13 @@ export class CorrettoDistribution extends JavaBase {
|
||||
return resolvedVersion;
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<ICorettoAvailableVersions[]> {
|
||||
private async getAvailableVersions(): Promise<ICorrettoAvailableVersions[]> {
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.architecture;
|
||||
const imageType = this.packageType;
|
||||
|
||||
if (core.isDebug()) {
|
||||
console.time('coretto-retrieve-available-versions');
|
||||
console.time('corretto-retrieve-available-versions');
|
||||
}
|
||||
|
||||
const availableVersionsUrl =
|
||||
@ -85,8 +85,8 @@ export class CorrettoDistribution extends JavaBase {
|
||||
throw Error(`Could not fetch latest corretto versions from ${availableVersionsUrl}`);
|
||||
}
|
||||
|
||||
const eligbleVersions = fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
|
||||
const availableVersions = this.getAvailableVersionsForPlatform(eligbleVersions);
|
||||
const eligibleVersions = fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
|
||||
const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions);
|
||||
|
||||
if (core.isDebug()) {
|
||||
this.printAvailableVersions(availableVersions);
|
||||
@ -96,19 +96,19 @@ export class CorrettoDistribution extends JavaBase {
|
||||
}
|
||||
|
||||
private getAvailableVersionsForPlatform(
|
||||
eligbleVersions: ICorrettoAllAvailableVersions['os']['arch']['imageType'] | undefined
|
||||
): ICorettoAvailableVersions[] {
|
||||
const availableVersions: ICorettoAvailableVersions[] = [];
|
||||
eligibleVersions: ICorrettoAllAvailableVersions['os']['arch']['imageType'] | undefined
|
||||
): ICorrettoAvailableVersions[] {
|
||||
const availableVersions: ICorrettoAvailableVersions[] = [];
|
||||
|
||||
for (const version in eligbleVersions) {
|
||||
const availableVersion = eligbleVersions[version];
|
||||
for (const version in eligibleVersions) {
|
||||
const availableVersion = eligibleVersions[version];
|
||||
for (const fileType in availableVersion) {
|
||||
const skipNonExtractableBinaries = fileType != getDownloadArchiveExtension();
|
||||
if (skipNonExtractableBinaries) {
|
||||
continue;
|
||||
}
|
||||
const availableVersionDetails = availableVersion[fileType];
|
||||
const correttoVersion = this.getCorettoVersion(availableVersionDetails.resource);
|
||||
const correttoVersion = this.getCorrettoVersion(availableVersionDetails.resource);
|
||||
|
||||
availableVersions.push({
|
||||
checksum: availableVersionDetails.checksum,
|
||||
@ -124,9 +124,9 @@ export class CorrettoDistribution extends JavaBase {
|
||||
return availableVersions;
|
||||
}
|
||||
|
||||
private printAvailableVersions(availableVersions: ICorettoAvailableVersions[]) {
|
||||
private printAvailableVersions(availableVersions: ICorrettoAvailableVersions[]) {
|
||||
core.startGroup('Print information about available versions');
|
||||
console.timeEnd('coretto-retrieve-available-versions');
|
||||
console.timeEnd('corretto-retrieve-available-versions');
|
||||
console.log(`Available versions: [${availableVersions.length}]`);
|
||||
console.log(
|
||||
availableVersions.map(item => `${item.version}: ${item.correttoVersion}`).join(', ')
|
||||
@ -135,7 +135,7 @@ export class CorrettoDistribution extends JavaBase {
|
||||
}
|
||||
|
||||
private getPlatformOption(): string {
|
||||
// Coretto has its own platform names so we need to map them
|
||||
// Corretto has its own platform names so we need to map them
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
return 'macos';
|
||||
@ -146,7 +146,7 @@ export class CorrettoDistribution extends JavaBase {
|
||||
}
|
||||
}
|
||||
|
||||
private getCorettoVersion(resource: string): string {
|
||||
private getCorrettoVersion(resource: string): string {
|
||||
const regex = /(\d+.+)\//;
|
||||
const match = regex.exec(resource);
|
||||
if (match === null) {
|
||||
|
@ -14,7 +14,7 @@ export interface ICorrettoAllAvailableVersions {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ICorettoAvailableVersions {
|
||||
export interface ICorrettoAvailableVersions {
|
||||
version: string;
|
||||
fileType: string;
|
||||
checksum: string;
|
||||
|
Reference in New Issue
Block a user