Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fb264a6b0 | ||
|
|
0a27862568 | ||
|
|
70003e7f9f | ||
|
|
814434c7a9 | ||
|
|
3282b5e43f | ||
|
|
26eec53160 |
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
|
||||
46
.github/workflows/test.yml
vendored
46
.github/workflows/test.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
build: # make sure build/ci work properly
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
npm install
|
||||
- run: |
|
||||
@@ -25,22 +25,22 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: ['17', '20', 'dev']
|
||||
java-version: ['21', '17', '20', 'dev']
|
||||
distribution: ['graalvm', 'graalvm-community']
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
include:
|
||||
- java-version: '17.0.7'
|
||||
- java-version: '21'
|
||||
distribution: ''
|
||||
os: ubuntu-latest
|
||||
- java-version: 'dev'
|
||||
distribution: ''
|
||||
os: windows-latest
|
||||
- java-version: '17.0.7'
|
||||
- java-version: '21'
|
||||
distribution: 'graalvm-community'
|
||||
os: ubuntu-latest
|
||||
components: 'native-image' # should print a warning but not fail
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
components: 'native-image'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -152,7 +152,7 @@ jobs:
|
||||
components: 'native-image'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -199,7 +199,7 @@ jobs:
|
||||
java-version: '17'
|
||||
os: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -252,7 +252,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -274,7 +274,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -297,7 +297,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -332,16 +332,16 @@ jobs:
|
||||
javac HelloWorld.java
|
||||
native-image -g HelloWorld
|
||||
./helloworld
|
||||
- name: Build Ruby-FFI with TruffleRuby
|
||||
run: |
|
||||
[[ $(which bundle) == *"graalvm"* ]] || exit 57
|
||||
git clone --depth 1 https://github.com/ffi/ffi.git
|
||||
pushd ffi > /dev/null
|
||||
# https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
|
||||
bundle install
|
||||
bundle exec rake libffi
|
||||
bundle exec rake compile
|
||||
bundle exec rake test
|
||||
popd > /dev/null
|
||||
# - name: Build Ruby-FFI with TruffleRuby
|
||||
# run: |
|
||||
# [[ $(which bundle) == *"graalvm"* ]] || exit 57
|
||||
# git clone --depth 1 https://github.com/ffi/ffi.git
|
||||
# pushd ffi > /dev/null
|
||||
# # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
|
||||
# bundle install
|
||||
# bundle exec rake libffi
|
||||
# bundle exec rake compile
|
||||
# bundle exec rake test
|
||||
# popd > /dev/null
|
||||
- name: Remove components
|
||||
run: gu remove espresso llvm-toolchain nodejs python ruby wasm
|
||||
|
||||
16
README.md
16
README.md
@@ -17,7 +17,7 @@ This action:
|
||||
|
||||
## Migrating from GraalVM 22.3 or Earlier to the New GraalVM for JDK 17 and Later
|
||||
|
||||
The new [GraalVM for JDK 17 and JDK 20 release](https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5) aligns the GraalVM version scheme with OpenJDK.
|
||||
The [GraalVM for JDK 17 and JDK 20 release](https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5) aligns the GraalVM version scheme with OpenJDK.
|
||||
As a result, this action no longer requires the `version` option to select a specific GraalVM version.
|
||||
At the same time, it introduces a new `distribution` option to select a specific GraalVM distribution (`graalvm`, `graalvm-community`, or `mandrel`).
|
||||
Therefore, to migrate your workflow to use the latest GraalVM release, replace the `version` with the `distribution` option in the workflow `yml` config, for example:
|
||||
@@ -54,10 +54,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '17.0.7'
|
||||
java-version: '21'
|
||||
distribution: 'graalvm' # See 'Options' for all available distributions
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Example step
|
||||
@@ -85,11 +85,11 @@ jobs:
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '17.0.7'
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.2' # GraalVM version
|
||||
@@ -146,7 +146,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
@@ -166,7 +166,7 @@ jobs:
|
||||
|
||||
| Name | Default | Description |
|
||||
|-----------------|:--------:|-------------|
|
||||
| `java-version`<br>*(required)* | n/a | `'17.0.7'` or `'20.0.1'` for a specific Java version, `'dev'` for a dev build with the latest Java version available.<br>(`'8'`, `'11'`, `'16'`, `'19'` are supported for older GraalVM releases.) |
|
||||
| `java-version`<br>*(required)* | n/a | `'21'` or `'17.0.7'` for a specific Java version, `'dev'` for a dev build with the latest Java version available.<br>(`'8'`, `'11'`, `'16'`, `'19'` are supported for older GraalVM releases.) |
|
||||
| `distribution` | `''` | GraalVM distribution (`graalvm` for Oracle GraalVM, `graalvm-community` for GraalVM Community Edition, `mandrel` for Mandrel). |
|
||||
| `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. |
|
||||
| `set-java-home` | `'true'` | If set to `'true'`, instructs the action to set `$JAVA_HOME` to the path of the GraalVM installation. Overrides any previous action or command that sets `$JAVA_HOME`. |
|
||||
|
||||
46
dist/main/index.js
generated
vendored
46
dist/main/index.js
generated
vendored
@@ -70308,32 +70308,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.checkForUpdates = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
function checkForUpdates(graalVMVersion, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '20';
|
||||
core.notice(`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`);
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.startsWith('22.3.') && javaVersion === '11') {
|
||||
core.notice('Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063');
|
||||
return;
|
||||
}
|
||||
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
|
||||
});
|
||||
if (javaVersion === '20') {
|
||||
core.notice('A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d');
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '21';
|
||||
core.notice(`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`);
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.startsWith('22.3.') && javaVersion === '11') {
|
||||
core.notice('Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063');
|
||||
return;
|
||||
}
|
||||
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
|
||||
}
|
||||
exports.checkForUpdates = checkForUpdates;
|
||||
|
||||
@@ -70824,7 +70817,7 @@ const assert_1 = __nccwpck_require__(9491);
|
||||
const uuid_1 = __nccwpck_require__(5840);
|
||||
function downloadGraalVMEELegacy(gdsToken, version, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const userAgent = `GraalVMGitHubAction/1.1.3 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`;
|
||||
const userAgent = `GraalVMGitHubAction/1.1.4 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`;
|
||||
const baseArtifact = yield fetchArtifact(userAgent, 'isBase:True', version, javaVersion);
|
||||
return downloadArtifact(gdsToken, userAgent, baseArtifact);
|
||||
});
|
||||
@@ -71384,6 +71377,11 @@ function run() {
|
||||
const isGraalVMforJDK17OrLater = distribution.length > 0 || graalVMVersion.length == 0;
|
||||
let graalVMHome;
|
||||
if (isGraalVMforJDK17OrLater) {
|
||||
if (enableCheckForUpdates &&
|
||||
(distribution === c.DISTRIBUTION_GRAALVM ||
|
||||
distribution === c.DISTRIBUTION_GRAALVM_COMMUNITY)) {
|
||||
(0, check_for_updates_1.checkForUpdates)(graalVMVersion, javaVersion);
|
||||
}
|
||||
switch (distribution) {
|
||||
case c.DISTRIBUTION_GRAALVM:
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDK(javaVersion);
|
||||
@@ -71445,7 +71443,7 @@ function run() {
|
||||
}
|
||||
else {
|
||||
if (enableCheckForUpdates) {
|
||||
yield (0, check_for_updates_1.checkForUpdates)(graalVMVersion, javaVersion);
|
||||
(0, check_for_updates_1.checkForUpdates)(graalVMVersion, javaVersion);
|
||||
}
|
||||
graalVMHome = yield graalvm.setUpGraalVMRelease(gdsToken, graalVMVersion, javaVersion);
|
||||
}
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"license": "UPL",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.0.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"private": true,
|
||||
"description": "GitHub Action for GraalVM",
|
||||
"main": "lib/main.js",
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import * as core from '@actions/core'
|
||||
|
||||
export async function checkForUpdates(
|
||||
export function checkForUpdates(
|
||||
graalVMVersion: string,
|
||||
javaVersion: string
|
||||
): Promise<void> {
|
||||
): void {
|
||||
if (javaVersion === '20') {
|
||||
core.notice(
|
||||
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d'
|
||||
)
|
||||
return
|
||||
}
|
||||
if (
|
||||
graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')
|
||||
) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '20'
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '21'
|
||||
core.notice(
|
||||
`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function downloadGraalVMEELegacy(
|
||||
version: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const userAgent = `GraalVMGitHubAction/1.1.3 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`
|
||||
const userAgent = `GraalVMGitHubAction/1.1.4 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`
|
||||
const baseArtifact = await fetchArtifact(
|
||||
userAgent,
|
||||
'isBase:True',
|
||||
|
||||
@@ -43,6 +43,13 @@ async function run(): Promise<void> {
|
||||
distribution.length > 0 || graalVMVersion.length == 0
|
||||
let graalVMHome
|
||||
if (isGraalVMforJDK17OrLater) {
|
||||
if (
|
||||
enableCheckForUpdates &&
|
||||
(distribution === c.DISTRIBUTION_GRAALVM ||
|
||||
distribution === c.DISTRIBUTION_GRAALVM_COMMUNITY)
|
||||
) {
|
||||
checkForUpdates(graalVMVersion, javaVersion)
|
||||
}
|
||||
switch (distribution) {
|
||||
case c.DISTRIBUTION_GRAALVM:
|
||||
graalVMHome = await graalvm.setUpGraalVMJDK(javaVersion)
|
||||
@@ -117,7 +124,7 @@ async function run(): Promise<void> {
|
||||
graalVMHome = await setUpMandrel(graalVMVersion, javaVersion)
|
||||
} else {
|
||||
if (enableCheckForUpdates) {
|
||||
await checkForUpdates(graalVMVersion, javaVersion)
|
||||
checkForUpdates(graalVMVersion, javaVersion)
|
||||
}
|
||||
graalVMHome = await graalvm.setUpGraalVMRelease(
|
||||
gdsToken,
|
||||
|
||||
Reference in New Issue
Block a user