-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support java-version-file #95
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,7 +187,8 @@ can be replaced with: | |
|
||
| Name | Default | Description | | ||
|-----------------|:--------:|-------------| | ||
| `java-version`<br>*(required)* | n/a | Java version <ul><li>major versions: `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.2'`, `'17.0.7'`</li><li>early access (EA) builds: `'22-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'`</li></ul> | | ||
| `java-version` | n/a | Java version <ul><li>major versions: `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.2'`, `'17.0.7'`</li><li>early access (EA) builds: `'22-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'`</li></ul> | | ||
| `java-version-file`| n/a | The path to the `.java-version` file. See more details in [about `.java-version` file](#Java-version-file) | | ||
| `distribution` | `'graalvm'` | GraalVM distribution <ul><li>Oracle GraalVM: `'graalvm'`</li><li>GraalVM Community Edition: `'graalvm-community'`</li><li>Mandrel: `'mandrel'`</li><li>Liberica: `'liberica'`</li></ul> | | ||
| `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. | | ||
|
@@ -203,6 +204,20 @@ can be replaced with: | |
|
||
**) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.* | ||
|
||
## Advanced Usage | ||
|
||
### Java-version file | ||
|
||
If the `java-version-file` input is specified, the action will try to extract the version from the file and install it. | ||
Action is able to recognize all variants of the version description according to [jenv](https://github.com/jenv/jenv). | ||
Valid entry options: | ||
``` | ||
major versions: 8, 11, 16, 17 | ||
more specific versions: 1.8.0.2, 17.0, 11.0, 11.0.4, 8.0.232, 8.0.282+8 | ||
early access (EA) versions: 15-ea, 15.0.0-ea, 15.0.0-ea.2, 15.0.0+2-ea | ||
versions with specified distribution: openjdk64-11.0.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
``` | ||
If the file contains multiple versions, only the first one will be recognized. | ||
|
||
## Contributing | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ import * as otypes from '@octokit/types' | |||||
export const INPUT_VERSION = 'version' | ||||||
export const INPUT_GDS_TOKEN = 'gds-token' | ||||||
export const INPUT_JAVA_VERSION = 'java-version' | ||||||
export const INPUT_JAVA_VERSION_FILE = 'java-version-file' | ||||||
export const INPUT_JAVA_PACKAGE = 'java-package' | ||||||
export const INPUT_DISTRIBUTION = 'distribution' | ||||||
export const INPUT_COMPONENTS = 'components' | ||||||
|
@@ -12,6 +13,8 @@ export const INPUT_CACHE = 'cache' | |||||
export const INPUT_CHECK_FOR_UPDATES = 'check-for-updates' | ||||||
export const INPUT_NI_MUSL = 'native-image-musl' | ||||||
|
||||||
export const DISTRIBUTIONS_ONLY_MAJOR_VERSION = ['corretto'] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
export const IS_LINUX = process.platform === 'linux' | ||||||
export const IS_MACOS = process.platform === 'darwin' | ||||||
export const IS_WINDOWS = process.platform === 'win32' | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8, 11, 16 are rather old. Could you please update this and the other lists to 17+?