Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more fixes
  • Loading branch information
Maxim Lobanov
Maxim Lobanov committed Mar 24, 2021
commit 5b26cf56c2a25754bc50928b0245e8ec4577a7a1
20 changes: 18 additions & 2 deletions .github/workflows/e2e-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:

setup-java-ea-versions-zulu:
name: zulu ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -100,10 +99,18 @@ jobs:
- name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
shell: bash
- name: setup-java
uses: ./
id: setup-java2
with:
java-version: ${{ matrix.version }}
distribution: zulu
- name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java2.outputs.path }}"
shell: bash

setup-java-ea-versions-adopt:
name: adopt ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -122,6 +129,15 @@ jobs:
- name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
shell: bash
- name: setup-java
uses: ./
id: setup-java2
with:
java-version: ${{ matrix.version }}
distribution: zulu
- name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java2.outputs.path }}"
shell: bash

setup-java-custom-package-type:
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }}
Expand Down
20 changes: 14 additions & 6 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3933,8 +3933,12 @@ class JavaBase {
}
getToolcacheVersionName(version) {
if (!this.stable) {
const cleanVersion = semver_1.default.clean(version);
return `${cleanVersion}-ea`;
if (version.includes('+')) {
return version.replace('+', '-ea.');
}
else {
return `${version}-ea`;
}
}
return version.replace('+', '-');
}
Expand All @@ -3943,13 +3947,17 @@ class JavaBase {
// if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions
const availableVersions = tc
.findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable)
.map(item => {
return {
version: item.replace(/-ea$/, '').replace('-', '+'),
path: util_1.getToolcachePath(this.toolcacheFolderName, item, this.architecture)
version: item
.replace('-ea.', '+')
.replace(/-ea$/, '')
.replace('-', '+'),
path: util_1.getToolcachePath(this.toolcacheFolderName, item, this.architecture),
stable: item.includes('-ea')
};
});
})
.filter(item => item.stable === this.stable);
console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);
const satisfiedVersions = availableVersions
.filter(item => util_1.isVersionSatisfies(this.version, item.version))
Expand Down
24 changes: 16 additions & 8 deletions src/distributions/base-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ export abstract class JavaBase {

protected getToolcacheVersionName(version: string): string {
if (!this.stable) {
const cleanVersion = semver.clean(version);
return `${cleanVersion}-ea`;
if (version.includes('+')) {
return version.replace('+', '-ea.');
} else {
return `${version}-ea`;
}
}

return version.replace('+', '-');
}

Expand All @@ -71,13 +75,17 @@ export abstract class JavaBase {
// if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions
const availableVersions = tc
.findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable)
.map(item => {
return {
version: item.replace(/-ea$/, '').replace('-', '+'),
path: getToolcachePath(this.toolcacheFolderName, item, this.architecture)
} as JavaInstallerResults;
});
version: item
.replace('-ea.', '+')
.replace(/-ea$/, '')
.replace('-', '+'),
path: getToolcachePath(this.toolcacheFolderName, item, this.architecture),
stable: item.includes('-ea')
};
})
.filter(item => item.stable === this.stable);

console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);

Expand All @@ -93,7 +101,7 @@ export abstract class JavaBase {

console.log(`satisfiedVersions = ${JSON.stringify(satisfiedVersions)}`);

return satisfiedVersions[0];
return satisfiedVersions[0] as JavaInstallerResults;
}

protected normalizeVersion(version: string) {
Expand Down