Compare commits

..

6 Commits

Author SHA1 Message Date
Bruno Borges 433ea1823b Merge branch 'main' into dependabot/github_actions/actions/checkout-7 2026-06-22 16:43:42 -04:00
Bruno Borges 525097081d Update undici artifacts to 6.27.0 (license cache + dist) (#1040)
* Update undici license cache to 6.27.0

The Licensed check failed because the cached license record for undici
was pinned to 6.24.1 while the installed dependency is 6.27.0, causing
"license: mit, allowed: false" / source enumeration errors.

Regenerate the cached record with `licensed cache` so it matches the
installed version. `licensed status` now reports 0 errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rebuild dist with undici 6.27.0

The committed dist/ bundle was built with undici 6.24.1, but the
lockfile resolves undici 6.27.0. The check-dist workflow rebuilds the
bundle and detected this drift (uncommitted changes after build).

Rebuild dist/setup and dist/cleanup with `npm run build` so the
committed bundle matches the installed undici 6.27.0, aligning with the
license cache update in this PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-22 16:43:17 -04:00
Copilot c09b25f3e7 Clarify README version syntax and migration guidance (#1038)
* Initial plan

* Clarify README version guidance

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-22 16:38:14 -04:00
Trass3r dc8e16ad37 add javac problem matcher (#562)
* add javac problemMatcher

* fix spaces

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Bruno Borges <bruno.borges@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-22 16:37:47 -04:00
Bruno Borges 3d27da4ac1 Update contributor guide with emoji for clarity (#1028) 2026-06-22 16:21:54 -04:00
dependabot[bot] 6159bf6264 Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 17:25:25 +00:00
15 changed files with 106 additions and 531 deletions
+12
View File
@@ -9,6 +9,18 @@
"message": 3
}
]
},
{
"owner": "javac",
"pattern": [
{
"regexp": "^([^:]+):(\\d+): (warning|error): (.+?)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
}
]
}
@@ -24,7 +24,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -51,7 +51,7 @@ jobs:
needs: gradle1-save
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -76,7 +76,7 @@ jobs:
needs: gradle1-save
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
+6 -6
View File
@@ -24,7 +24,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -50,7 +50,7 @@ jobs:
needs: gradle-save
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
@@ -73,7 +73,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
@@ -97,7 +97,7 @@ jobs:
needs: maven-save
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
@@ -124,7 +124,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for sbt
uses: ./
id: setup-java
@@ -174,7 +174,7 @@ jobs:
needs: sbt-save
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run setup-java with the cache for sbt
uses: ./
id: setup-java
+3 -3
View File
@@ -21,7 +21,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Download Adopt OpenJDK file
run: |
if ($IsLinux) {
@@ -58,7 +58,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Download Zulu OpenJDK file
run: |
if ($IsLinux) {
@@ -95,7 +95,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Download Eclipse Temurin file
run: |
if ($IsLinux) {
+4 -4
View File
@@ -25,7 +25,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -60,7 +60,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -96,7 +96,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -133,7 +133,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
+14 -14
View File
@@ -73,7 +73,7 @@ jobs:
version: '24-ea'
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -99,7 +99,7 @@ jobs:
version: ['21', '17']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Install bash
run: apk add --no-cache bash
- name: setup-java
@@ -149,7 +149,7 @@ jobs:
version: '17.0.7'
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -184,7 +184,7 @@ jobs:
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -220,7 +220,7 @@ jobs:
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -259,7 +259,7 @@ jobs:
version: ['17-ea', '15.0.0-ea.14']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -281,7 +281,7 @@ jobs:
version: ['17-ea']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -303,7 +303,7 @@ jobs:
version: ['17-ea', '21-ea']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -390,7 +390,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -418,7 +418,7 @@ jobs:
version: ['11']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: setup-java
uses: ./
id: setup-java
@@ -441,7 +441,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create .java-version file
shell: bash
run: echo "17" > .java-version
@@ -470,7 +470,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create .java-version file
shell: bash
run: echo "11" > .java-version
@@ -498,7 +498,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create .java-version file
shell: bash
run: echo "17.0.10" > .java-version
@@ -526,7 +526,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Create .java-version file
shell: bash
run: echo "openjdk64-17.0.10" > .java-version
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Checking out
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Publish
id: publish
uses: actions/publish-immutable-action@v0.0.4
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: undici
version: 6.24.1
version: 6.27.0
type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org
+11 -11
View File
@@ -25,13 +25,6 @@ This action allows you to work with Java and Scala projects.
For more details, see the full release notes on the [releases page](https://github.com/actions/setup-java/releases/tag/v5.0.0)
## V2 vs V1
- V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK out of the box. V1 supports only Azul Zulu OpenJDK.
- V2 requires you to specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2.
For information about the latest releases, recent updates, and newly supported distributions, please refer to the `setup-java` [Releases](https://github.com/actions/setup-java/releases).
## Usage
- `java-version`: The Java version that is going to be set up. Takes a whole or [semver](#supported-version-syntax) Java version. If not specified, the action will expect `java-version-file` input to be specified.
@@ -98,8 +91,8 @@ steps:
```
#### Supported version syntax
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation:
- major versions: `8`, `11`, `16`, `17`, `21`, `25`
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation. The values below are examples, not an exhaustive list:
- major versions, such as: `8`, `11`, `16`, `17`, `21`, `25`
- more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0`
- early access (EA) versions: `15-ea`, `15.0.0-ea`
@@ -119,7 +112,6 @@ Currently, the following distributions are supported:
| `dragonwell` | [Alibaba Dragonwell JDK](https://dragonwell-jdk.io/) | [`dragonwell` license](https://www.aliyun.com/product/dragonwell/)
| `sapmachine` | [SAP SapMachine JDK/JRE](https://sapmachine.io/) | [`sapmachine` license](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE)
| `graalvm` | [Oracle GraalVM](https://www.graalvm.org/) | [`graalvm` license](https://www.oracle.com/downloads/licenses/graal-free-license.html)
| `graalvm-community` | [GraalVM Community](https://github.com/graalvm/graalvm-ce-builds/releases) | [`graalvm-community` license](https://github.com/oracle/graal/blob/master/LICENSE)
| `jetbrains` | [JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime/) | [`jetbrains` license](https://github.com/JetBrains/JetBrainsRuntime/blob/main/LICENSE)
> [!NOTE]
@@ -127,7 +119,6 @@ Currently, the following distributions are supported:
> - AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` and `adopt-openj9`, to `temurin` and `semeru` respectively, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
> - For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
> - To comply with the GraalVM Free Terms and Conditions (GFTC) license, it is recommended to use GraalVM JDK 17 version 17.0.12, as this is the only version of GraalVM JDK 17 available under the GFTC license. Additionally, it is encouraged to consider upgrading to GraalVM JDK 21, which offers the latest features and improvements.
> - GraalVM Community is available as `distribution: 'graalvm-community'` for stable JDK 17 and later releases published on GitHub.
**NOTE:** Oracle JDK 17 licensing varies by patch level. As shown on the [JDK 17 Archive](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) (versions up to 17.0.12 are under the [NFTC](https://www.oracle.com/downloads/licenses/no-fee-license.html) license) and the [JDK 17.0.13+ Archive](https://www.oracle.com/java/technologies/javase/jdk17-0-13-later-archive-downloads.html) (versions 17.0.13 and later are under the [OTN](https://www.oracle.com/downloads/licenses/javase-license1.html) license). To stay on the free NFTC license, use `distribution: 'oracle'` with `java-version: '17.0.12'` (or earlier) instead of the floating `'17'`. Alternatively, upgrade to Oracle JDK 21+, which remains under the NFTC license.
@@ -294,6 +285,15 @@ In the example above multiple JDKs are installed for the same job. The result af
- [Modifying Maven Toolchains](docs/advanced-usage.md#Modifying-Maven-Toolchains)
- [Java Version File](docs/advanced-usage.md#Java-version-file)
## V2 vs V1
Examples in this README use `actions/setup-java@v5`, but the main migration note from V1 still applies to all later major versions (`v2`, `v3`, `v4`, and `v5`):
- Starting with V2, the action supports custom distributions. V1 supports only Azul Zulu OpenJDK.
- Starting with V2, you must specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, so only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2.
For information about the latest releases, recent updates, and newly supported distributions, please refer to the `setup-java` [Releases](https://github.com/actions/setup-java/releases).
## Recommended permissions
When using the `setup-java` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
@@ -3,11 +3,7 @@ import * as tc from '@actions/tool-cache';
import * as http from '@actions/http-client';
import fs from 'fs';
import path from 'path';
import {
GraalVMCommunityDistribution,
GraalVMDistribution
} from '../../src/distributions/graalvm/installer';
import {getJavaDistribution} from '../../src/distributions/distribution-factory';
import {GraalVMDistribution} from '../../src/distributions/graalvm/installer';
import {JavaInstallerOptions} from '../../src/distributions/base-models';
import * as util from '../../src/util';
@@ -45,7 +41,6 @@ beforeAll(() => {
describe('GraalVMDistribution', () => {
let distribution: GraalVMDistribution;
let communityDistribution: GraalVMCommunityDistribution;
let mockHttpClient: jest.Mocked<http.HttpClient>;
let spyCoreError: jest.SpyInstance;
@@ -60,11 +55,9 @@ describe('GraalVMDistribution', () => {
jest.clearAllMocks();
distribution = new GraalVMDistribution(defaultOptions);
communityDistribution = new GraalVMCommunityDistribution(defaultOptions);
mockHttpClient = new http.HttpClient() as jest.Mocked<http.HttpClient>;
(distribution as any).http = mockHttpClient;
(communityDistribution as any).http = mockHttpClient;
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
@@ -249,21 +242,6 @@ describe('GraalVMDistribution', () => {
path: '/cached/java/path'
});
});
it('should use a dedicated toolcache folder for GraalVM Community', async () => {
const result = await (communityDistribution as any).downloadTool(javaRelease);
expect(tc.cacheDir).toHaveBeenCalledWith(
path.join('/tmp/extracted', 'graalvm-jdk-17.0.5'),
'Java_GraalVM_Community_jdk',
'17.0.5',
'x64'
);
expect(result).toEqual({
version: '17.0.5',
path: '/cached/java/path'
});
});
});
describe('findPackageForDownload', () => {
@@ -970,104 +948,5 @@ describe('GraalVMDistribution', () => {
configurable: true
});
});
describe('GraalVMCommunityDistribution', () => {
beforeEach(() => {
jest.spyOn(communityDistribution, 'getPlatform').mockReturnValue('linux');
});
it('should resolve an exact GraalVM Community version from GitHub releases', async () => {
mockHttpClient.getJson.mockResolvedValue({
result: [
{
draft: false,
prerelease: false,
assets: [
{
name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
browser_download_url:
'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await (communityDistribution as any).findPackageForDownload(
'21.0.2'
);
expect(result).toEqual({
url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
version: '21.0.2'
});
});
it('should resolve the latest GraalVM Community release for a major version', async () => {
mockHttpClient.getJson.mockResolvedValue({
result: [
{
draft: false,
prerelease: false,
assets: [
{
name: 'graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz',
browser_download_url:
'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz'
}
]
},
{
draft: false,
prerelease: false,
assets: [
{
name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
browser_download_url:
'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await (communityDistribution as any).findPackageForDownload(
'21'
);
expect(result).toEqual({
url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
version: '21.0.2'
});
});
it('should reject GraalVM Community early access requests', async () => {
(communityDistribution as any).stable = false;
await expect(
(communityDistribution as any).findPackageForDownload('23')
).rejects.toThrow('GraalVM Community does not provide early access builds');
});
});
});
});
describe('distribution factory', () => {
const defaultOptions: JavaInstallerOptions = {
version: '17',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
};
it('should map graalvm-community to the community installer', () => {
const community = getJavaDistribution('graalvm-community', defaultOptions);
expect(community).toBeInstanceOf(GraalVMCommunityDistribution);
});
});
+24 -129
View File
@@ -78771,7 +78771,6 @@ var JavaDistribution;
JavaDistribution["Dragonwell"] = "dragonwell";
JavaDistribution["SapMachine"] = "sapmachine";
JavaDistribution["GraalVM"] = "graalvm";
JavaDistribution["GraalVMCommunity"] = "graalvm-community";
JavaDistribution["JetBrains"] = "jetbrains";
})(JavaDistribution || (JavaDistribution = {}));
function getJavaDistribution(distributionName, installerOptions, jdkFile) {
@@ -78803,8 +78802,6 @@ function getJavaDistribution(distributionName, installerOptions, jdkFile) {
return new installer_11.SapMachineDistribution(installerOptions);
case JavaDistribution.GraalVM:
return new installer_12.GraalVMDistribution(installerOptions);
case JavaDistribution.GraalVMCommunity:
return new installer_12.GraalVMCommunityDistribution(installerOptions);
case JavaDistribution.JetBrains:
return new installer_13.JetBrainsDistribution(installerOptions);
default:
@@ -79072,27 +79069,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GraalVMCommunityDistribution = exports.GraalVMDistribution = void 0;
exports.GraalVMDistribution = void 0;
const core = __importStar(__nccwpck_require__(37484));
const tc = __importStar(__nccwpck_require__(33472));
const fs_1 = __importDefault(__nccwpck_require__(79896));
const path_1 = __importDefault(__nccwpck_require__(16928));
const semver_1 = __importDefault(__nccwpck_require__(62088));
const base_installer_1 = __nccwpck_require__(79935);
const http_client_1 = __nccwpck_require__(54844);
const util_1 = __nccwpck_require__(54527);
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
const GRAALVM_DOWNLOAD_URL = 'https://www.graalvm.org/downloads/';
const GRAALVM_COMMUNITY_RELEASES_URL = 'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases?per_page=100';
const GRAALVM_COMMUNITY_RELEASES_PAGE_ORIGIN = 'https://api.github.com';
const GRAALVM_COMMUNITY_DOWNLOAD_URL = 'https://github.com/graalvm/graalvm-ce-builds/releases';
const IS_WINDOWS = process.platform === 'win32';
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
const GRAALVM_MIN_VERSION = 17;
const SUPPORTED_ARCHITECTURES = ['x64', 'aarch64'];
class GraalVMDistribution extends base_installer_1.JavaBase {
constructor(installerOptions, distributionName = 'GraalVM') {
super(distributionName, installerOptions);
constructor(installerOptions) {
super('GraalVM', installerOptions);
}
downloadTool(javaRelease) {
return __awaiter(this, void 0, void 0, function* () {
@@ -79126,50 +79119,36 @@ class GraalVMDistribution extends base_installer_1.JavaBase {
}
findPackageForDownload(range) {
return __awaiter(this, void 0, void 0, function* () {
this.validateVersionRange(range);
const arch = this.getSupportedArchitecture();
// Add input validation
if (!range || typeof range !== 'string') {
throw new Error('Version range is required and must be a string');
}
const arch = this.distributionArchitecture();
if (!SUPPORTED_ARCHITECTURES.includes(arch)) {
throw new Error(`Unsupported architecture: ${this.architecture}. Supported architectures are: ${SUPPORTED_ARCHITECTURES.join(', ')}`);
}
if (!this.stable) {
return this.findEABuildDownloadUrl(`${range}-ea`);
}
const { platform, extension, major } = this.validateStableBuildRequest(range);
if (this.packageType !== 'jdk') {
throw new Error('GraalVM provides only the `jdk` package type');
}
const platform = this.getPlatform();
const extension = (0, util_1.getDownloadArchiveExtension)();
const major = range.includes('.') ? range.split('.')[0] : range;
const majorVersion = parseInt(major);
if (isNaN(majorVersion)) {
throw new Error(`Invalid version format: ${range}`);
}
if (majorVersion < GRAALVM_MIN_VERSION) {
throw new Error(`GraalVM is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`);
}
const fileUrl = this.constructFileUrl(range, major, platform, arch, extension);
const response = yield this.http.head(fileUrl);
this.handleHttpResponse(response, range);
return { url: fileUrl, version: range };
});
}
validateVersionRange(range) {
if (!range || typeof range !== 'string') {
throw new Error('Version range is required and must be a string');
}
}
getSupportedArchitecture() {
const arch = this.distributionArchitecture();
if (!SUPPORTED_ARCHITECTURES.includes(arch)) {
throw new Error(`Unsupported architecture: ${this.architecture}. Supported architectures are: ${SUPPORTED_ARCHITECTURES.join(', ')}`);
}
return arch;
}
validateStableBuildRequest(range) {
if (this.packageType !== 'jdk') {
throw new Error(`${this.distribution} provides only the \`jdk\` package type`);
}
const platform = this.getPlatform();
const extension = (0, util_1.getDownloadArchiveExtension)();
const major = range.includes('.') ? range.split('.')[0] : range;
const majorVersion = parseInt(major);
if (isNaN(majorVersion)) {
throw new Error(`Invalid version format: ${range}`);
}
if (majorVersion < GRAALVM_MIN_VERSION) {
throw new Error(`${this.distribution} is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`);
}
return {
platform,
major,
extension
};
}
constructFileUrl(range, major, platform, arch, extension) {
return range.includes('.')
? `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`
@@ -79260,90 +79239,6 @@ class GraalVMDistribution extends base_installer_1.JavaBase {
}
}
exports.GraalVMDistribution = GraalVMDistribution;
class GraalVMCommunityDistribution extends GraalVMDistribution {
constructor(installerOptions) {
super(installerOptions, 'GraalVM Community');
}
get toolcacheFolderName() {
return `Java_GraalVM_Community_${this.packageType}`;
}
findPackageForDownload(range) {
return __awaiter(this, void 0, void 0, function* () {
this.validateVersionRange(range);
if (!this.stable) {
throw new Error('GraalVM Community does not provide early access builds');
}
const arch = this.getSupportedArchitecture();
const { platform, extension } = this.validateStableBuildRequest(range);
const availableVersions = yield this.getAvailableVersionsForPlatform(platform, arch, extension);
const satisfiedVersion = availableVersions
.filter(item => (0, util_1.isVersionSatisfies)(range, item.version))
.sort((a, b) => -semver_1.default.compareBuild(a.version, b.version))[0];
if (!satisfiedVersion) {
const error = this.createVersionNotFoundError(range, availableVersions.map(item => item.version), `Platform: ${platform}`);
error.message += `\nPlease check if this version is available at ${GRAALVM_COMMUNITY_DOWNLOAD_URL}.`;
throw error;
}
return satisfiedVersion;
});
}
getAvailableVersionsForPlatform(platform, arch, extension) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const headers = (0, util_1.getGitHubHttpHeaders)();
const availableVersions = new Map();
let releasesUrl = GRAALVM_COMMUNITY_RELEASES_URL;
let pageCount = 0;
while (releasesUrl) {
pageCount++;
const response = yield this.http.getJson(releasesUrl, headers);
const releases = Array.isArray(response.result) ? response.result : [];
for (const release of releases) {
if (release.draft || release.prerelease) {
continue;
}
for (const asset of (_a = release.assets) !== null && _a !== void 0 ? _a : []) {
const releaseForPlatform = this.toCommunityReleaseForPlatform(asset, platform, arch, extension);
if (releaseForPlatform) {
availableVersions.set(releaseForPlatform.version, releaseForPlatform);
}
}
}
const nextUrl = (0, util_1.getNextPageUrlFromLinkHeader)(response.headers);
if (nextUrl &&
!(0, util_1.validatePaginationUrl)(nextUrl, GRAALVM_COMMUNITY_RELEASES_PAGE_ORIGIN)) {
core.warning(`Ignoring pagination link with unexpected origin: ${nextUrl}`);
break;
}
releasesUrl = nextUrl;
if (releases.length === 0) {
break;
}
if (pageCount >= util_1.MAX_PAGINATION_PAGES) {
core.warning(`Reached pagination safeguard limit (${util_1.MAX_PAGINATION_PAGES} pages) while listing GraalVM Community releases.`);
break;
}
}
return [...availableVersions.values()];
});
}
toCommunityReleaseForPlatform(asset, platform, arch, extension) {
const match = asset.name.match(/^graalvm-community-jdk-(?<version>\d+(?:\.\d+)+)_(?<platform>linux|macos|windows)-(?<arch>x64|aarch64)_bin\.(?<extension>tar\.gz|zip)$/);
if (!(match === null || match === void 0 ? void 0 : match.groups)) {
return null;
}
if (match.groups.platform !== platform ||
match.groups.arch !== arch ||
match.groups.extension !== extension) {
return null;
}
return {
version: (0, util_1.convertVersionToSemver)(match.groups.version),
url: asset.browser_download_url
};
}
}
exports.GraalVMCommunityDistribution = GraalVMCommunityDistribution;
/***/ }),
-16
View File
@@ -10,7 +10,6 @@
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
- [SapMachine](#SapMachine)
- [GraalVM](#GraalVM)
- [GraalVM Community](#GraalVM-Community)
- [JetBrains](#JetBrains)
- [Installing custom Java package type](#Installing-custom-Java-package-type)
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
@@ -173,21 +172,6 @@ steps:
native-image -cp java HelloWorldApp
```
### GraalVM Community
**NOTE:** GraalVM Community is available for stable JDK 17 and later releases.
```yaml
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'graalvm-community'
java-version: '21'
- run: |
java -cp java HelloWorldApp
native-image -cp java HelloWorldApp
```
### JetBrains
**NOTE:** JetBrains is only available for LTS versions on 11 or later (11, 17, 21, etc.).
+4 -4
View File
@@ -6,13 +6,13 @@ We have prepared a short guide so that the process of making your contribution i
## How can I contribute...
* [Contribute Documentation:green_book:](#contribute-documentation)
* [:green_book: Contribute Documentation](#contribute-documentation)
* [Contribute Code :computer:](#contribute-code)
* [:computer: Contribute Code](#contribute-code)
* [Provide Support on Issues:pencil:](#provide-support-on-issues)
* [:pencil: Provide Support on Issues](#provide-support-on-issues)
* [Review Pull Requests:mag:](#review-pull-requests)
* [:mag: Review Pull Requests](#review-pull-requests)
## Contribute documentation
+1 -7
View File
@@ -11,10 +11,7 @@ import {CorrettoDistribution} from './corretto/installer';
import {OracleDistribution} from './oracle/installer';
import {DragonwellDistribution} from './dragonwell/installer';
import {SapMachineDistribution} from './sapmachine/installer';
import {
GraalVMCommunityDistribution,
GraalVMDistribution
} from './graalvm/installer';
import {GraalVMDistribution} from './graalvm/installer';
import {JetBrainsDistribution} from './jetbrains/installer';
enum JavaDistribution {
@@ -32,7 +29,6 @@ enum JavaDistribution {
Dragonwell = 'dragonwell',
SapMachine = 'sapmachine',
GraalVM = 'graalvm',
GraalVMCommunity = 'graalvm-community',
JetBrains = 'jetbrains'
}
@@ -78,8 +74,6 @@ export function getJavaDistribution(
return new SapMachineDistribution(installerOptions);
case JavaDistribution.GraalVM:
return new GraalVMDistribution(installerOptions);
case JavaDistribution.GraalVMCommunity:
return new GraalVMCommunityDistribution(installerOptions);
case JavaDistribution.JetBrains:
return new JetBrainsDistribution(installerOptions);
default:
+19 -208
View File
@@ -2,7 +2,6 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
import fs from 'fs';
import path from 'path';
import semver from 'semver';
import {JavaBase} from '../base-installer';
import {HttpCodes} from '@actions/http-client';
import {GraalVMEAVersion} from './models';
@@ -12,24 +11,14 @@ import {
JavaInstallerResults
} from '../base-models';
import {
convertVersionToSemver,
extractJdkFile,
getDownloadArchiveExtension,
getGitHubHttpHeaders,
getNextPageUrlFromLinkHeader,
isVersionSatisfies,
MAX_PAGINATION_PAGES,
renameWinArchive,
validatePaginationUrl
renameWinArchive
} from '../../util';
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
const GRAALVM_DOWNLOAD_URL = 'https://www.graalvm.org/downloads/';
const GRAALVM_COMMUNITY_RELEASES_URL =
'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases?per_page=100';
const GRAALVM_COMMUNITY_RELEASES_PAGE_ORIGIN = 'https://api.github.com';
const GRAALVM_COMMUNITY_DOWNLOAD_URL =
'https://github.com/graalvm/graalvm-ce-builds/releases';
const IS_WINDOWS = process.platform === 'win32';
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
const GRAALVM_MIN_VERSION = 17;
@@ -37,23 +26,9 @@ const SUPPORTED_ARCHITECTURES = ['x64', 'aarch64'] as const;
type SupportedArchitecture = (typeof SUPPORTED_ARCHITECTURES)[number];
type OsVersions = 'linux' | 'macos' | 'windows';
interface GraalVMCommunityAsset {
name: string;
browser_download_url: string;
}
interface GraalVMCommunityRelease {
draft: boolean;
prerelease: boolean;
assets: GraalVMCommunityAsset[];
}
export class GraalVMDistribution extends JavaBase {
constructor(
installerOptions: JavaInstallerOptions,
distributionName = 'GraalVM'
) {
super(distributionName, installerOptions);
constructor(installerOptions: JavaInstallerOptions) {
super('GraalVM', installerOptions);
}
protected async downloadTool(
@@ -110,36 +85,11 @@ export class GraalVMDistribution extends JavaBase {
protected async findPackageForDownload(
range: string
): Promise<JavaDownloadRelease> {
this.validateVersionRange(range);
const arch = this.getSupportedArchitecture();
if (!this.stable) {
return this.findEABuildDownloadUrl(`${range}-ea`);
}
const {platform, extension, major} = this.validateStableBuildRequest(range);
const fileUrl = this.constructFileUrl(
range,
major,
platform,
arch,
extension
);
const response = await this.http.head(fileUrl);
this.handleHttpResponse(response, range);
return {url: fileUrl, version: range};
}
protected validateVersionRange(range: string): void {
// Add input validation
if (!range || typeof range !== 'string') {
throw new Error('Version range is required and must be a string');
}
}
protected getSupportedArchitecture(): SupportedArchitecture {
const arch = this.distributionArchitecture();
if (!SUPPORTED_ARCHITECTURES.includes(arch as SupportedArchitecture)) {
throw new Error(
@@ -147,18 +97,12 @@ export class GraalVMDistribution extends JavaBase {
);
}
return arch as SupportedArchitecture;
}
if (!this.stable) {
return this.findEABuildDownloadUrl(`${range}-ea`);
}
protected validateStableBuildRequest(range: string): {
platform: OsVersions;
extension: string;
major: string;
} {
if (this.packageType !== 'jdk') {
throw new Error(
`${this.distribution} provides only the \`jdk\` package type`
);
throw new Error('GraalVM provides only the `jdk` package type');
}
const platform = this.getPlatform();
@@ -172,15 +116,22 @@ export class GraalVMDistribution extends JavaBase {
if (majorVersion < GRAALVM_MIN_VERSION) {
throw new Error(
`${this.distribution} is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`
`GraalVM is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`
);
}
return {
platform,
const fileUrl = this.constructFileUrl(
range,
major,
platform,
arch,
extension
};
);
const response = await this.http.head(fileUrl);
this.handleHttpResponse(response, range);
return {url: fileUrl, version: range};
}
private constructFileUrl(
@@ -329,143 +280,3 @@ export class GraalVMDistribution extends JavaBase {
return result;
}
}
export class GraalVMCommunityDistribution extends GraalVMDistribution {
constructor(installerOptions: JavaInstallerOptions) {
super(installerOptions, 'GraalVM Community');
}
protected get toolcacheFolderName(): string {
return `Java_GraalVM_Community_${this.packageType}`;
}
protected async findPackageForDownload(
range: string
): Promise<JavaDownloadRelease> {
this.validateVersionRange(range);
if (!this.stable) {
throw new Error('GraalVM Community does not provide early access builds');
}
const arch = this.getSupportedArchitecture();
const {platform, extension} = this.validateStableBuildRequest(range);
const availableVersions = await this.getAvailableVersionsForPlatform(
platform,
arch,
extension
);
const satisfiedVersion = availableVersions
.filter(item => isVersionSatisfies(range, item.version))
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
if (!satisfiedVersion) {
const error = this.createVersionNotFoundError(
range,
availableVersions.map(item => item.version),
`Platform: ${platform}`
);
error.message += `\nPlease check if this version is available at ${GRAALVM_COMMUNITY_DOWNLOAD_URL}.`;
throw error;
}
return satisfiedVersion;
}
private async getAvailableVersionsForPlatform(
platform: OsVersions,
arch: SupportedArchitecture,
extension: string
): Promise<JavaDownloadRelease[]> {
const headers = getGitHubHttpHeaders();
const availableVersions = new Map<string, JavaDownloadRelease>();
let releasesUrl: string | null = GRAALVM_COMMUNITY_RELEASES_URL;
let pageCount = 0;
while (releasesUrl) {
pageCount++;
const response = await this.http.getJson<GraalVMCommunityRelease[]>(
releasesUrl,
headers
);
const releases = Array.isArray(response.result) ? response.result : [];
for (const release of releases) {
if (release.draft || release.prerelease) {
continue;
}
for (const asset of release.assets ?? []) {
const releaseForPlatform = this.toCommunityReleaseForPlatform(
asset,
platform,
arch,
extension
);
if (releaseForPlatform) {
availableVersions.set(
releaseForPlatform.version,
releaseForPlatform
);
}
}
}
const nextUrl = getNextPageUrlFromLinkHeader(response.headers);
if (
nextUrl &&
!validatePaginationUrl(nextUrl, GRAALVM_COMMUNITY_RELEASES_PAGE_ORIGIN)
) {
core.warning(
`Ignoring pagination link with unexpected origin: ${nextUrl}`
);
break;
}
releasesUrl = nextUrl;
if (releases.length === 0) {
break;
}
if (pageCount >= MAX_PAGINATION_PAGES) {
core.warning(
`Reached pagination safeguard limit (${MAX_PAGINATION_PAGES} pages) while listing GraalVM Community releases.`
);
break;
}
}
return [...availableVersions.values()];
}
private toCommunityReleaseForPlatform(
asset: GraalVMCommunityAsset,
platform: OsVersions,
arch: SupportedArchitecture,
extension: string
): JavaDownloadRelease | null {
const match = asset.name.match(
/^graalvm-community-jdk-(?<version>\d+(?:\.\d+)+)_(?<platform>linux|macos|windows)-(?<arch>x64|aarch64)_bin\.(?<extension>tar\.gz|zip)$/
);
if (!match?.groups) {
return null;
}
if (
match.groups.platform !== platform ||
match.groups.arch !== arch ||
match.groups.extension !== extension
) {
return null;
}
return {
version: convertVersionToSemver(match.groups.version),
url: asset.browser_download_url
};
}
}