From 24d519f08b96659710edac62e415b93460b02a3d Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 16 Oct 2024 14:38:54 +0200 Subject: [PATCH 1/4] Recommend `actions/upload-artifact@v4`. [ci skip] Fixes #111. https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82d987d..e912bbc 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ jobs: ./helloworld - name: Upload binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: helloworld-${{ matrix.os }} path: helloworld* From 7094f9de6a046f8014172c409928c762d9b9863b Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 16 Oct 2024 21:48:34 +0200 Subject: [PATCH 2/4] Upgrade job to `17.0.13`. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ddf1537..ac05f3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: distribution: 'graalvm' os: ubuntu-latest set-gds-token: true - - java-version: '17.0.12' # Upgrade to '17.0.13' after Oct 2024 + - java-version: '17.0.13' distribution: 'graalvm' os: ubuntu-latest set-gds-token: true From b4ad29066b4fa544bfd8741d41cf64c9c594408c Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 16 Oct 2024 21:49:30 +0200 Subject: [PATCH 3/4] Add 'Supported distributions' section. Related to #107. --- README.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e912bbc..ac6e306 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ jobs: - uses: actions/checkout@v4 - uses: graalvm/setup-graalvm@v1 with: - java-version: '21' # See 'Options' section below for all supported versions - distribution: 'graalvm' # See 'Options' section below for all available distributions + java-version: '21' # See 'Options' for more details + distribution: 'graalvm' # See 'Supported distributions' for available options github-token: ${{ secrets.GITHUB_TOKEN }} - name: Example step run: | @@ -176,12 +176,26 @@ jobs: +## Supported distributions + +Currently, the following distributions are supported: + +| Keyword | Distribution | Official site | License +|-|-|-|-| +| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html) +| `graalvm-community` | GraalVM Community Edition | [Link](https://www.graalvm.org/) | [Link](https://github.com/oracle/graal/blob/master/LICENSE) +| `mandrel` | Mandrel | [Link](https://github.com/graalvm/mandrel) | [Link](https://github.com/graalvm/mandrel/blob/default/LICENSE) | +| `liberica` | Liberica NIK | [Link](https://bell-sw.com/liberica-native-image-kit/) | [Link](https://bell-sw.com/liberica_nik_eula/) | + + ## Options +This actions can be configured with the following options: + | Name | Default | Description | |-----------------|:--------:|-------------| -| `java-version`
*(required)* | n/a | Java version
  • major versions: `'21'`, `'17'`, `'11'`, `'8'`
  • specific versions: `'21.0.3'`, `'17.0.11'`
  • early access (EA) builds: `'23-ea'` *(requires `distribution: 'graalvm'`)*
  • latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*
  • dev builds: `'dev'`
| -| `distribution` | `'graalvm'` | GraalVM distribution
  • Oracle GraalVM: `'graalvm'`
  • GraalVM Community Edition: `'graalvm-community'`
  • Mandrel: `'mandrel'`
  • Liberica: `'liberica'`
| +| `java-version`
*(required)* | n/a | Java version
  • major versions: `'23'`, `'21'`, `'17'`, `'11'`, `'8'`
  • specific versions: `'21.0.3'`, `'17.0.11'`
  • early access (EA) builds: `'24-ea'` *(requires `distribution: 'graalvm'`)*
  • latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*
  • dev builds: `'dev'`
| +| `distribution` | `'graalvm'` | GraalVM distribution (see [supported distributions](#supported-distributions)) | | `java-package` | `'jdk'` | The package type (`'jdk'` or `'jdk+fx'`). Currently applies to Liberica only. | | `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`. | @@ -231,7 +245,7 @@ can be replaced with: # ... - uses: graalvm/setup-graalvm@v1 with: - java-version: '17.0.7' # for a specific JDK 17; or '17' for the latest JDK 17 + java-version: '17.0.12' # for a specific JDK 17; or '17' for the latest JDK 17 distribution: 'graalvm' # New 'distribution' option # ... ``` From 7cb90790ccef8d0a0d094e99b48378373d7c53fd Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 17 Oct 2024 14:51:38 +0200 Subject: [PATCH 4/4] Fix and improve `README.md`. Thanks to @Marcono1234 for the suggestions. --- README.md | 109 +++++++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index ac6e306..58a589a 100644 --- a/README.md +++ b/README.md @@ -104,41 +104,41 @@ jobs: 1. Obtain a token for the GraalVM Download Service. For this, replace `your@email.com` with your email address and run the following `curl` command: -```bash -curl -sS -X POST "https://gds.oracle.com/api/20220101/licenseAcceptance" \ - -H "Content-Type: application/json" \ - -d "{ \"email\": \"your@email.com\", \"licenseId\": \"D53FA58D12817B3CE0530F15000A74CA\", \"type\": \"GENERATE_TOKEN_AND_ACCEPT_LICENSE\"}" -``` + ```bash + curl -sS -X POST "https://gds.oracle.com/api/20220101/licenseAcceptance" \ + -H "Content-Type: application/json" \ + -d "{ \"email\": \"your@email.com\", \"licenseId\": \"D53FA58D12817B3CE0530F15000A74CA\", \"type\": \"GENERATE_TOKEN_AND_ACCEPT_LICENSE\"}" + ``` -The response should look like this: + The response should look like this: -```json -{"token":"","status":"UNVERIFIED"} -``` + ```json + {"token":"","status":"UNVERIFIED"} + ``` 2. Store the value of `` as a [GitHub Action secret][gha-secrets]. For the following template, we use the name `GDS_TOKEN`. 3. Check your emails and accept the license to activate the token. 4. Use `java-version: '17'` (or a specific version such as `17.0.13`) and provide the `GDS_TOKEN` as shown in the following template: -```yml -name: Build with Oracle GraalVM for JDK 17 via GDS -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: graalvm/setup-graalvm@v1 - with: - distribution: 'graalvm' - java-version: '17' - gds-token: ${{ secrets.GDS_TOKEN }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Example step - run: | - java --version - native-image --version -``` + ```yml + name: Build with Oracle GraalVM for JDK 17 via GDS + on: [push, pull_request] + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: graalvm/setup-graalvm@v1 + with: + distribution: 'graalvm' + java-version: '17' + gds-token: ${{ secrets.GDS_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Example step + run: | + java --version + native-image --version + ``` @@ -150,28 +150,28 @@ jobs: 1. Download the version of [GraalVM Enterprise Edition (EE)][graalvm-ee] you want to run on GitHub Actions. 2. Use the [GraalVM Updater][gu] to install the GraalVM components you need on GitHub Actions and accept the corresponding licenses. 3. Run `$GRAALVM_HOME/bin/gu --show-ee-token` to display your token for the GraalVM Download Service. -4. Store this token as a [GitHub Action secret][gha-secrets]. In the following template, we use the name `GDS_TOKEN`. - -```yml -name: GraalVM Enterprise Edition build -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: graalvm/setup-graalvm@v1 - with: - version: '22.3.0' - gds-token: ${{ secrets.GDS_TOKEN }} - java-version: '17' - components: 'native-image' - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Example step - run: | - java --version - native-image --version -``` +4. Store this token as a [GitHub Action secret][gha-secrets]. In the following template, we use the name `GDS_TOKEN`: + + ```yml + name: GraalVM Enterprise Edition build + on: [push, pull_request] + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: graalvm/setup-graalvm@v1 + with: + version: '22.3.0' + gds-token: ${{ secrets.GDS_TOKEN }} + java-version: '17' + components: 'native-image' + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Example step + run: | + java --version + native-image --version + ``` @@ -180,10 +180,10 @@ jobs: Currently, the following distributions are supported: -| Keyword | Distribution | Official site | License +| Keyword | Distribution | Official site | License | |-|-|-|-| -| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html) -| `graalvm-community` | GraalVM Community Edition | [Link](https://www.graalvm.org/) | [Link](https://github.com/oracle/graal/blob/master/LICENSE) +| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html) | +| `graalvm-community` | GraalVM Community Edition | [Link](https://www.graalvm.org/) | [Link](https://github.com/oracle/graal/blob/master/LICENSE) | | `mandrel` | Mandrel | [Link](https://github.com/graalvm/mandrel) | [Link](https://github.com/graalvm/mandrel/blob/default/LICENSE) | | `liberica` | Liberica NIK | [Link](https://bell-sw.com/liberica-native-image-kit/) | [Link](https://bell-sw.com/liberica_nik_eula/) | @@ -207,7 +207,8 @@ This actions can be configured with the following options: | `native-image-pr-reports-update-existing` *) | `'false'` | Instead of posting another comment, update an existing PR comment with the latest Native Image build report. Requires `native-image-pr-reports` to be `true`. | | `components` | `''` | Comma-separated list of GraalVM components (e.g., `native-image` or `ruby,nodejs`) that will be installed by the [GraalVM Updater][gu]. | | `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`
`mandrel-X.Y.Z.W` or `X.Y.Z.W-Final` (e.g., `mandrel-21.3.0.0-Final` or `21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],
`mandrel-latest` or `latest` for the latest Mandrel stable release. | -| `gds-token` | `''` | Download token for the GraalVM Download Service. at <> Store this token as a [GitHub Action secret][gha-secrets]. For thie followingtemplate, we use the name `GDS_TOKEN`.. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)). | +| `gds-token` | `''` Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up Oracle GraalVM (see [Oracle GraalVM via GDS template](#template-for-oracle-graalvm-via-graalvm-download-service)) or GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)) via GDS. | + **) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.*