Compare commits

..

6 Commits

Author SHA1 Message Date
Fabio Niephaus
0a27862568 Bump version to 1.1.4. 2023-09-19 15:51:30 +02:00
Fabio Niephaus
70003e7f9f Disable Build Ruby-FFI with TruffleRuby step. 2023-09-19 15:50:03 +02:00
Fabio Niephaus
814434c7a9 Add upgrade notice for JDK 20 users. 2023-09-19 15:41:40 +02:00
Fabio Niephaus
3282b5e43f Updates for GraalVM for JDK 21 release. 2023-09-19 15:41:39 +02:00
Fabio Niephaus
26eec53160 Use and recommend actions/checkout@v4. 2023-09-19 14:30:35 +02:00
Fabio Niephaus
0e29e36dce Fix version check for gu and add a better warning. 2023-09-06 10:55:08 +02:00
9 changed files with 71 additions and 46 deletions

View File

@@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set Node.js 16.x - name: Set Node.js 16.x
uses: actions/setup-node@v3 uses: actions/setup-node@v3

View File

@@ -15,7 +15,7 @@ jobs:
build: # make sure build/ci work properly build: # make sure build/ci work properly
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: | - run: |
npm install npm install
- run: | - run: |
@@ -25,18 +25,22 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
java-version: ['17', '20', 'dev'] java-version: ['21', '17', '20', 'dev']
distribution: ['graalvm', 'graalvm-community'] distribution: ['graalvm', 'graalvm-community']
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
include: include:
- java-version: '17.0.7' - java-version: '21'
distribution: '' distribution: ''
os: ubuntu-latest os: ubuntu-latest
- java-version: 'dev' - java-version: 'dev'
distribution: '' distribution: ''
os: windows-latest os: windows-latest
- java-version: '21'
distribution: 'graalvm-community'
os: ubuntu-latest
components: 'native-image' # should print a warning but not fail
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -95,7 +99,7 @@ jobs:
components: 'native-image' components: 'native-image'
os: ubuntu-latest os: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -148,7 +152,7 @@ jobs:
components: 'native-image' components: 'native-image'
os: ubuntu-latest os: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -195,7 +199,7 @@ jobs:
java-version: '17' java-version: '17'
os: windows-latest os: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -226,7 +230,7 @@ jobs:
contents: read contents: read
pull-requests: write # for `native-image-pr-reports` option pull-requests: write # for `native-image-pr-reports` option
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -248,7 +252,7 @@ jobs:
contents: read contents: read
pull-requests: write # for `native-image-pr-reports` option pull-requests: write # for `native-image-pr-reports` option
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -270,7 +274,7 @@ jobs:
contents: read contents: read
pull-requests: write # for `native-image-pr-reports` option pull-requests: write # for `native-image-pr-reports` option
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -293,7 +297,7 @@ jobs:
contents: read contents: read
pull-requests: write # for `native-image-pr-reports` option pull-requests: write # for `native-image-pr-reports` option
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run setup-graalvm action - name: Run setup-graalvm action
uses: ./ uses: ./
with: with:
@@ -328,16 +332,16 @@ jobs:
javac HelloWorld.java javac HelloWorld.java
native-image -g HelloWorld native-image -g HelloWorld
./helloworld ./helloworld
- name: Build Ruby-FFI with TruffleRuby # - name: Build Ruby-FFI with TruffleRuby
run: | # run: |
[[ $(which bundle) == *"graalvm"* ]] || exit 57 # [[ $(which bundle) == *"graalvm"* ]] || exit 57
git clone --depth 1 https://github.com/ffi/ffi.git # git clone --depth 1 https://github.com/ffi/ffi.git
pushd ffi > /dev/null # pushd ffi > /dev/null
# https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62 # # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
bundle install # bundle install
bundle exec rake libffi # bundle exec rake libffi
bundle exec rake compile # bundle exec rake compile
bundle exec rake test # bundle exec rake test
popd > /dev/null # popd > /dev/null
- name: Remove components - name: Remove components
run: gu remove espresso llvm-toolchain nodejs python ruby wasm run: gu remove espresso llvm-toolchain nodejs python ruby wasm

View File

@@ -17,7 +17,7 @@ This action:
## Migrating from GraalVM 22.3 or Earlier to the New GraalVM for JDK 17 and Later ## 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. 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`). 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: 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: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1 - uses: graalvm/setup-graalvm@v1
with: with:
java-version: '17.0.7' java-version: '21'
distribution: 'graalvm' # See 'Options' for all available distributions distribution: 'graalvm' # See 'Options' for all available distributions
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Example step - name: Example step
@@ -85,11 +85,11 @@ jobs:
matrix: matrix:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1 - uses: graalvm/setup-graalvm@v1
with: with:
java-version: '17.0.7' java-version: '21'
distribution: 'graalvm' distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true' native-image-job-reports: 'true'
@@ -118,7 +118,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1 - uses: graalvm/setup-graalvm@v1
with: with:
version: '22.3.2' # GraalVM version version: '22.3.2' # GraalVM version
@@ -146,7 +146,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1 - uses: graalvm/setup-graalvm@v1
with: with:
version: '22.3.0' version: '22.3.0'
@@ -166,7 +166,7 @@ jobs:
| Name | Default | Description | | 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). | | `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. | | `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`. | | `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`. |

17
dist/main/index.js generated vendored
View File

@@ -70322,9 +70322,13 @@ exports.checkForUpdates = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
function checkForUpdates(graalVMVersion, javaVersion) { function checkForUpdates(graalVMVersion, javaVersion) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (javaVersion === '20') {
core.notice('A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/p/ee01177dd12d');
return;
}
if (graalVMVersion.length > 0 && if (graalVMVersion.length > 0 &&
(javaVersion === '17' || javaVersion === '19')) { (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`); 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; return;
} }
@@ -70824,7 +70828,7 @@ const assert_1 = __nccwpck_require__(9491);
const uuid_1 = __nccwpck_require__(5840); const uuid_1 = __nccwpck_require__(5840);
function downloadGraalVMEELegacy(gdsToken, version, javaVersion) { function downloadGraalVMEELegacy(gdsToken, version, javaVersion) {
return __awaiter(this, void 0, void 0, function* () { 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); const baseArtifact = yield fetchArtifact(userAgent, 'isBase:True', version, javaVersion);
return downloadArtifact(gdsToken, userAgent, baseArtifact); return downloadArtifact(gdsToken, userAgent, baseArtifact);
}); });
@@ -71269,8 +71273,13 @@ function setUpGUComponents(javaVersion, graalVMVersion, graalVMHome, components,
} }
if (graalVMVersion === c.VERSION_DEV || if (graalVMVersion === c.VERSION_DEV ||
javaVersion === c.VERSION_DEV || javaVersion === c.VERSION_DEV ||
((0, semver_1.valid)(javaVersion) && (0, semver_1.gte)(javaVersion, '21'))) { ((0, semver_1.valid)(javaVersion) && (0, semver_1.gte)(javaVersion, '21.0.0'))) {
core.warning(`Unable to install component(s): '${components.join(',')}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855`); if (components.length == 1 && components[0] === 'native-image') {
core.warning(`Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995`);
}
else {
core.warning(`Unable to install component(s): '${components.join(',')}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855`);
}
} }
else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) { else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
core.warning(`Mandrel does not support GraalVM component(s): '${components.join(',')}'`); core.warning(`Mandrel does not support GraalVM component(s): '${components.join(',')}'`);

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "setup-graalvm", "name": "setup-graalvm",
"version": "1.1.3", "version": "1.1.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "setup-graalvm", "name": "setup-graalvm",
"version": "1.1.3", "version": "1.1.4",
"license": "UPL", "license": "UPL",
"dependencies": { "dependencies": {
"@actions/cache": "^3.0.4", "@actions/cache": "^3.0.4",

View File

@@ -1,6 +1,6 @@
{ {
"name": "setup-graalvm", "name": "setup-graalvm",
"version": "1.1.3", "version": "1.1.4",
"private": true, "private": true,
"description": "GitHub Action for GraalVM", "description": "GitHub Action for GraalVM",
"main": "lib/main.js", "main": "lib/main.js",

View File

@@ -4,11 +4,17 @@ export async function checkForUpdates(
graalVMVersion: string, graalVMVersion: string,
javaVersion: string javaVersion: string
): Promise<void> { ): Promise<void> {
if (javaVersion === '20') {
core.notice(
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/p/ee01177dd12d'
)
return
}
if ( if (
graalVMVersion.length > 0 && graalVMVersion.length > 0 &&
(javaVersion === '17' || javaVersion === '19') (javaVersion === '17' || javaVersion === '19')
) { ) {
const recommendedJDK = javaVersion === '17' ? '17' : '20' const recommendedJDK = javaVersion === '17' ? '17' : '21'
core.notice( 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` `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`
) )

View File

@@ -32,7 +32,7 @@ export async function downloadGraalVMEELegacy(
version: string, version: string,
javaVersion: string javaVersion: string
): Promise<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( const baseArtifact = await fetchArtifact(
userAgent, userAgent,
'isBase:True', 'isBase:True',

View File

@@ -37,13 +37,19 @@ export async function setUpGUComponents(
if ( if (
graalVMVersion === c.VERSION_DEV || graalVMVersion === c.VERSION_DEV ||
javaVersion === c.VERSION_DEV || javaVersion === c.VERSION_DEV ||
(semverValid(javaVersion) && semverGte(javaVersion, '21')) (semverValid(javaVersion) && semverGte(javaVersion, '21.0.0'))
) { ) {
core.warning( if (components.length == 1 && components[0] === 'native-image') {
`Unable to install component(s): '${components.join( core.warning(
',' `Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995`
)}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855` )
) } else {
core.warning(
`Unable to install component(s): '${components.join(
','
)}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855`
)
}
} else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) { } else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
core.warning( core.warning(
`Mandrel does not support GraalVM component(s): '${components.join(',')}'` `Mandrel does not support GraalVM component(s): '${components.join(',')}'`