mirror of
https://github.com/actions/setup-java.git
synced 2026-07-28 07:04:32 +02:00
Handle legacy OpenJDK URL layout
This commit is contained in:
@@ -176,12 +176,13 @@ describe('OpenJdkDistribution', () => {
|
|||||||
'x64'
|
'x64'
|
||||||
);
|
);
|
||||||
const windowsRelease = distribution['parseReleases'](
|
const windowsRelease = distribution['parseReleases'](
|
||||||
'<a href="https://download.java.net/java/GA/jdk10/hash/13/GPL/openjdk-10_windows-x64_bin.tar.gz">tar.gz</a>',
|
'<a href="https://download.java.net/java/GA/jdk10/hash/13/openjdk-10.0.2_windows-x64_bin.tar.gz">tar.gz</a>',
|
||||||
'windows',
|
'windows',
|
||||||
'x64'
|
'x64'
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(macRelease[0].version).toBe('16.0.0+7');
|
expect(macRelease[0].version).toBe('16.0.0+7');
|
||||||
|
expect(windowsRelease[0].version).toBe('10.0.2+13');
|
||||||
expect(windowsRelease[0].url.endsWith('.tar.gz')).toBe(true);
|
expect(windowsRelease[0].url.endsWith('.tar.gz')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -131939,7 +131939,7 @@ class OpenJdkDistribution extends JavaBase {
|
|||||||
const pattern = new RegExp(`href="(https://download\\.java\\.net/[^"]+/openjdk-([^"_]+)_${platformPattern}-${arch}_bin\\.${extensionPattern})"`, 'g');
|
const pattern = new RegExp(`href="(https://download\\.java\\.net/[^"]+/openjdk-([^"_]+)_${platformPattern}-${arch}_bin\\.${extensionPattern})"`, 'g');
|
||||||
return Array.from(html.matchAll(pattern), match => {
|
return Array.from(html.matchAll(pattern), match => {
|
||||||
const url = match[1];
|
const url = match[1];
|
||||||
const build = url.match(/\/(\d+)\/GPL\/openjdk-/)?.[1];
|
const build = url.match(/\/(\d+)\/(?:GPL\/)?openjdk-/)?.[1];
|
||||||
return {
|
return {
|
||||||
version: this.toSemver(match[2], build),
|
version: this.toSemver(match[2], build),
|
||||||
url
|
url
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export class OpenJdkDistribution extends JavaBase {
|
|||||||
|
|
||||||
return Array.from(html.matchAll(pattern), match => {
|
return Array.from(html.matchAll(pattern), match => {
|
||||||
const url = match[1];
|
const url = match[1];
|
||||||
const build = url.match(/\/(\d+)\/GPL\/openjdk-/)?.[1];
|
const build = url.match(/\/(\d+)\/(?:GPL\/)?openjdk-/)?.[1];
|
||||||
return {
|
return {
|
||||||
version: this.toSemver(match[2], build),
|
version: this.toSemver(match[2], build),
|
||||||
url
|
url
|
||||||
|
|||||||
Reference in New Issue
Block a user