Skip to content

dist: Support Tencent Kona JDK#672

Open
johnshajiang wants to merge 1 commit into
actions:mainfrom
johnshajiang:support-kona-jdk
Open

dist: Support Tencent Kona JDK#672
johnshajiang wants to merge 1 commit into
actions:mainfrom
johnshajiang:support-kona-jdk

Conversation

@johnshajiang

@johnshajiang johnshajiang commented Aug 14, 2024

Copy link
Copy Markdown
Contributor

Description:
This PR adds Tencent Kona JDK into setup-java.
It supports the major versions 8, 11, 17 and 21.
The supported platforms are Linux x86_64/aarch64, macOS x86_64/aarch64 and Windows x86_64.

Currently, only the latest stable releases are supported, and only jdk (no jre) binaries are available.
A configuration maintains these releases.

Related issue:
#671

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@johnshajiang

Copy link
Copy Markdown
Contributor Author

I just refreshed the commit.
It resolved the file conflicts and supported Tencent Kona JDK 21.

@johnshajiang

Copy link
Copy Markdown
Contributor Author

I just updated the commit again, and the file conflicts are resolved.

@johnshajiang johnshajiang force-pushed the support-kona-jdk branch 3 times, most recently from 41ce0ca to 109744b Compare February 13, 2025 08:31
johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 13, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 13, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 13, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 13, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 13, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
@johnshajiang

johnshajiang commented Feb 13, 2025

Copy link
Copy Markdown
Contributor Author

I already executed npm run build for re-generating the index.js files, and committed them.

> setup-java@4.0.0 build
> ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts

ncc: Version 0.38.1
ncc: Compiling file index.js into CJS
ncc: Using typescript@5.3.3 (local user-provided)
5204kB  dist/setup/index.js
5204kB  [2160ms] - ncc 0.38.1
ncc: Version 0.38.1
ncc: Compiling file index.js into CJS
ncc: Using typescript@5.3.3 (local user-provided)
3777kB  dist/cleanup/index.js
3777kB  [1804ms] - ncc 0.38.1

But Check dist check task always failed.

johnshajiang added a commit to johnshajiang/actions-setup-java that referenced this pull request Feb 14, 2025
Signed-off-by: John Jiang <johnsjiang@tencent.com>
@brunoborges brunoborges added feature request New feature or request to improve the current logic distribution JDK distribution/version/source support and removed feature request New feature or request to improve the current logic labels Jun 22, 2026
@brunoborges

Copy link
Copy Markdown
Contributor

Linking the tracking issue: this PR implements #671 (Tencent Kona JDK support). Maintainers — adding Closes #671 to the PR description will auto-close the issue on merge.

@brunoborges brunoborges added the stale The issue has been open for a year without any activity label Jun 23, 2026
@brunoborges brunoborges changed the title Support Tencent Kona JDK dist: Support Tencent Kona JDK Jun 23, 2026
brunoborges pushed a commit to johnshajiang/actions-setup-java that referenced this pull request Jun 23, 2026
Signed-off-by: John Jiang <johnsjiang@tencent.com>
@brunoborges brunoborges requested a review from Copilot June 23, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Tencent Kona JDK distribution to actions/setup-java, including the installer implementation, documentation, and test/e2e coverage.

Changes:

  • Add a new KonaDistribution that resolves Kona JDK downloads from the published kona-v1.json configuration.
  • Register the new kona distribution in the distribution factory and bundled dist output.
  • Update docs, e2e matrix, and add unit tests + fixture manifest data for Kona.
Show a summary per file
File Description
src/distributions/kona/models.ts Adds Kona release/config TypeScript models.
src/distributions/kona/installer.ts Implements Kona distribution resolution and download/extract logic.
src/distributions/distribution-factory.ts Registers kona as a supported distribution and wires installer creation.
README.md Documents kona as a supported distribution and links to advanced usage.
docs/advanced-usage.md Adds a “Tencent Kona” usage section and TOC entry.
__tests__/distributors/kona-installer.test.ts Adds unit tests for Kona release selection and error cases.
__tests__/data/kona.json Adds fixture manifest data used by the Kona unit tests.
.github/workflows/e2e-versions.yml Adds kona to the e2e distribution matrix.
dist/setup/index.js Updates the bundled action output to include the new Kona installer.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/9 changed files
  • Comments generated: 5

Comment on lines +63 to +82
const availableReleases = await this.getAvailableReleases();
const releases = availableReleases
.filter(item => {
return isVersionSatisfies(version, item.version);
})
.map(item => {
return {
version: item.version,
url: item.downloadUrl
} as JavaDownloadRelease;
});

if (!releases.length) {
throw new Error(
`No Kona release for the specified version "${version}" on OS "${this.getOs()}" and arch "${this.getArch()}".`
);
}

return releases[0];
}
Comment on lines +4 to +6
import fs from 'fs';
import path from 'path';

Comment on lines +14 to +18
import {
extractJdkFile,
getDownloadArchiveExtension,
isVersionSatisfies
} from '../../util';
Comment on lines +31 to +36
const javaArchivePath = await tc.downloadTool(javaRelease.url);

core.info(`Extracting Java archive...`);

const extension = getDownloadArchiveExtension();
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
Comment on lines +85 to +104
if (core.isDebug()) {
console.time('Retrieving available releases for Kona took'); // eslint-disable-line no-console
}

const releaseInfo = await this.fetchReleaseInfo();
if (!releaseInfo) {
throw new Error(`Couldn't fetch Kona release information`);
}

const availableReleases = this.chooseReleases(
this.getOs(),
this.getArch(),
releaseInfo
);

if (core.isDebug()) {
core.startGroup('Print information about available releases');
core.debug(availableReleases.map(item => item.version).join(', '));
core.endGroup();
}
Signed-off-by: John Jiang <johnsjiang@tencent.com>
@johnshajiang

Copy link
Copy Markdown
Contributor Author

@brunoborges
Thank you for picking this PR back up and updating it.
Is there anything else you need from me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distribution JDK distribution/version/source support stale The issue has been open for a year without any activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants