Compare commits

...

4 Commits

Author SHA1 Message Date
Gerrit Grunwald
3b7f5a116f
Merge d3af3ec854 into 8e04ddff28 2024-08-29 12:04:30 -07:00
mahabaleshwars
8e04ddff28
Update Error Messages and Fix Architecture Detection for IBM Semeru (#677)
* Updated Error message for Semuru

* Enhanced error message

* Added architecture to semeru

* updated code to provide aarch64 for arm64 architecture for semeru

* updated semver message

* updated semver error message

* Enhanced the error message for semeru

* Enhanced error messaged for semeru distribution

* enhanced error message for semeru
2024-08-29 13:48:24 -05:00
John Jiang
67fbd726da
Fix typos on Corretto (#665) (#666) 2024-08-08 12:07:49 -05:00
Gerrit Grunwald
d3af3ec854
Added the option jdk+crac
Because with Azul Zulu one can also use jdk+crac in combination with version 17 and 21, this was added to the README.md and advanced-usage.md.
This PR contains no code changes, just documentation.
2024-02-02 16:59:47 +01:00
6 changed files with 20 additions and 15 deletions

View File

@ -31,7 +31,7 @@ This action allows you to work with Java and Scala projects.
- `distribution`: _(required)_ Java [distribution](#supported-distributions). - `distribution`: _(required)_ Java [distribution](#supported-distributions).
- `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`. - `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`, `jdk+crac`. Default value: `jdk`.
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine. - `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.

View File

@ -207,7 +207,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
`Unsupported architecture for IBM Semeru: ${arch}, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64` `Unsupported architecture for IBM Semeru: ${arch} for your current OS version, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
); );
} }
); );

13
dist/setup/index.js vendored
View File

@ -123961,7 +123961,7 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
const arch = this.distributionArchitecture(); const arch = this.distributionArchitecture();
const imageType = this.packageType; const imageType = this.packageType;
if (core.isDebug()) { if (core.isDebug()) {
console.time('Retrieving available versions for Coretto took'); // eslint-disable-line no-console console.time('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
} }
const availableVersionsUrl = 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'; const availableVersionsUrl = 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
const fetchCurrentVersions = yield this.http.getJson(availableVersionsUrl); const fetchCurrentVersions = yield this.http.getJson(availableVersionsUrl);
@ -123973,7 +123973,7 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions); const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions);
if (core.isDebug()) { if (core.isDebug()) {
core.startGroup('Print information about available versions'); core.startGroup('Print information about available versions');
console.timeEnd('Retrieving available versions for Coretto took'); // eslint-disable-line no-console console.timeEnd('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
core.debug(`Available versions: [${availableVersions.length}]`); core.debug(`Available versions: [${availableVersions.length}]`);
core.debug(availableVersions core.debug(availableVersions
.map(item => `${item.version}: ${item.correttoVersion}`) .map(item => `${item.version}: ${item.correttoVersion}`)
@ -124939,8 +124939,9 @@ class SemeruDistribution extends base_installer_1.JavaBase {
} }
findPackageForDownload(version) { findPackageForDownload(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (!supportedArchitectures.includes(this.architecture)) { const arch = this.distributionArchitecture();
throw new Error(`Unsupported architecture for IBM Semeru: ${this.architecture}, the following are supported: ${supportedArchitectures.join(', ')}`); if (!supportedArchitectures.includes(arch)) {
throw new Error(`Unsupported architecture for IBM Semeru: ${this.architecture} for your current OS version, the following are supported: ${supportedArchitectures.join(', ')}`);
} }
if (!this.stable) { if (!this.stable) {
throw new Error('IBM Semeru does not provide builds for early access versions'); throw new Error('IBM Semeru does not provide builds for early access versions');
@ -124974,7 +124975,7 @@ class SemeruDistribution extends base_installer_1.JavaBase {
const availableOptionsMessage = availableOptions const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}` ? `\nAvailable versions: ${availableOptions}`
: ''; : '';
throw new Error(`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`); throw new Error(`Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`);
} }
return resolvedFullVersion; return resolvedFullVersion;
}); });
@ -124999,7 +125000,7 @@ class SemeruDistribution extends base_installer_1.JavaBase {
getAvailableVersions() { getAvailableVersions() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const platform = this.getPlatformOption(); const platform = this.getPlatformOption();
const arch = this.architecture; const arch = this.distributionArchitecture();
const imageType = this.packageType; const imageType = this.packageType;
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
const releaseType = this.stable ? 'ga' : 'ea'; const releaseType = this.stable ? 'ga' : 'ea';

View File

@ -58,7 +58,7 @@ steps:
with: with:
distribution: 'zulu' distribution: 'zulu'
java-version: '21' java-version: '21'
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx, jdk+crac) - defaults to jdk
- run: java -cp java HelloWorldApp - run: java -cp java HelloWorldApp
``` ```

View File

@ -93,7 +93,7 @@ export class CorrettoDistribution extends JavaBase {
const imageType = this.packageType; const imageType = this.packageType;
if (core.isDebug()) { if (core.isDebug()) {
console.time('Retrieving available versions for Coretto took'); // eslint-disable-line no-console console.time('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
} }
const availableVersionsUrl = const availableVersionsUrl =
@ -116,7 +116,7 @@ export class CorrettoDistribution extends JavaBase {
if (core.isDebug()) { if (core.isDebug()) {
core.startGroup('Print information about available versions'); core.startGroup('Print information about available versions');
console.timeEnd('Retrieving available versions for Coretto took'); // eslint-disable-line no-console console.timeEnd('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
core.debug(`Available versions: [${availableVersions.length}]`); core.debug(`Available versions: [${availableVersions.length}]`);
core.debug( core.debug(
availableVersions availableVersions

View File

@ -33,11 +33,15 @@ export class SemeruDistribution extends JavaBase {
protected async findPackageForDownload( protected async findPackageForDownload(
version: string version: string
): Promise<JavaDownloadRelease> { ): Promise<JavaDownloadRelease> {
if (!supportedArchitectures.includes(this.architecture)) { const arch = this.distributionArchitecture();
if (!supportedArchitectures.includes(arch)) {
throw new Error( throw new Error(
`Unsupported architecture for IBM Semeru: ${ `Unsupported architecture for IBM Semeru: ${
this.architecture this.architecture
}, the following are supported: ${supportedArchitectures.join(', ')}` } for your current OS version, the following are supported: ${supportedArchitectures.join(
', '
)}`
); );
} }
@ -81,7 +85,7 @@ export class SemeruDistribution extends JavaBase {
? `\nAvailable versions: ${availableOptions}` ? `\nAvailable versions: ${availableOptions}`
: ''; : '';
throw new Error( throw new Error(
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}` `Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`
); );
} }
@ -124,7 +128,7 @@ export class SemeruDistribution extends JavaBase {
public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> { public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> {
const platform = this.getPlatformOption(); const platform = this.getPlatformOption();
const arch = this.architecture; const arch = this.distributionArchitecture();
const imageType = this.packageType; const imageType = this.packageType;
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
const releaseType = this.stable ? 'ga' : 'ea'; const releaseType = this.stable ? 'ga' : 'ea';