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: setup-java-ea-versions-zulu:
name: zulu ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} name: zulu ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -100,10 +99,18 @@ jobs:
- name: Verify Java - name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
shell: bash 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: setup-java-ea-versions-adopt:
name: adopt ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} name: adopt ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -122,6 +129,15 @@ jobs:
- name: Verify Java - name: Verify Java
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
shell: bash 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: setup-java-custom-package-type:
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }} 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) { getToolcacheVersionName(version) {
if (!this.stable) { if (!this.stable) {
const cleanVersion = semver_1.default.clean(version); if (version.includes('+')) {
return `${cleanVersion}-ea`; return version.replace('+', '-ea.');
}
else {
return `${version}-ea`;
}
} }
return version.replace('+', '-'); return version.replace('+', '-');
} }
@ -3943,13 +3947,17 @@ class JavaBase {
// if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions // if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions
const availableVersions = tc const availableVersions = tc
.findAllVersions(this.toolcacheFolderName, this.architecture) .findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable)
.map(item => { .map(item => {
return { return {
version: item.replace(/-ea$/, '').replace('-', '+'), version: item
path: util_1.getToolcachePath(this.toolcacheFolderName, item, this.architecture) .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)}`); console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);
const satisfiedVersions = availableVersions const satisfiedVersions = availableVersions
.filter(item => util_1.isVersionSatisfies(this.version, item.version)) .filter(item => util_1.isVersionSatisfies(this.version, item.version))

View file

@ -60,9 +60,13 @@ export abstract class JavaBase {
protected getToolcacheVersionName(version: string): string { protected getToolcacheVersionName(version: string): string {
if (!this.stable) { if (!this.stable) {
const cleanVersion = semver.clean(version); if (version.includes('+')) {
return `${cleanVersion}-ea`; return version.replace('+', '-ea.');
} else {
return `${version}-ea`;
} }
}
return version.replace('+', '-'); 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 // if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions
const availableVersions = tc const availableVersions = tc
.findAllVersions(this.toolcacheFolderName, this.architecture) .findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable)
.map(item => { .map(item => {
return { return {
version: item.replace(/-ea$/, '').replace('-', '+'), version: item
path: getToolcachePath(this.toolcacheFolderName, item, this.architecture) .replace('-ea.', '+')
} as JavaInstallerResults; .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)}`); console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);
@ -93,7 +101,7 @@ export abstract class JavaBase {
console.log(`satisfiedVersions = ${JSON.stringify(satisfiedVersions)}`); console.log(`satisfiedVersions = ${JSON.stringify(satisfiedVersions)}`);
return satisfiedVersions[0]; return satisfiedVersions[0] as JavaInstallerResults;
} }
protected normalizeVersion(version: string) { protected normalizeVersion(version: string) {