more fixes

This commit is contained in:
Maxim Lobanov 2021-03-24 20:30:55 +03:00
parent 8326d77a03
commit 5b26cf56c2
3 changed files with 48 additions and 16 deletions

View file

@ -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
@ -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
@ -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 }}

20
dist/setup/index.js vendored
View file

@ -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('+', '-');
}
@ -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))

View file

@ -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('+', '-');
}
@ -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)}`);
@ -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) {