mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 17:36:45 +00:00
Convert Corretto version to semver notation
This commit is contained in:
parent
191ba8c6ba
commit
0a93947425
2 changed files with 4318 additions and 4298 deletions
8603
dist/setup/index.js
vendored
8603
dist/setup/index.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -62,7 +62,7 @@ export class CorrettoDistribution extends JavaBase {
|
||||||
.filter(item => item.version == version)
|
.filter(item => item.version == version)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
return {
|
return {
|
||||||
version: item.correttoVersion,
|
version: this.convertVersionToSemver(item.correttoVersion),
|
||||||
url: item.downloadLink
|
url: item.downloadLink
|
||||||
} as JavaDownloadRelease;
|
} as JavaDownloadRelease;
|
||||||
});
|
});
|
||||||
|
@ -179,4 +179,15 @@ export class CorrettoDistribution extends JavaBase {
|
||||||
}
|
}
|
||||||
return match[1];
|
return match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private convertVersionToSemver(version: string) {
|
||||||
|
const versionArray = version.split('.');
|
||||||
|
const mainVersion = versionArray.slice(0, 3).join('.');
|
||||||
|
if (versionArray.length > 3) {
|
||||||
|
// intentionally ignore more than 4 numbers because it is invalid semver
|
||||||
|
return `${mainVersion}+${versionArray.slice(3).join('.')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mainVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue