You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add support for .sdkmanrc file in java-version-file parameter (#736)
* chore(e2e-versions): Add e2e test scenario on `setup-java-version-from-file-major-minor-patch-with-dist` for `.sdkmanrc`
* chore(e2e-versions): Update `setup-java-version-from-file-major-minor-patch-with-dist` test to include the file name of the java-version-file that is used
* feat: Add support for `.sdkmanrc` as *Java Version File*
* chore: Add test for the latest known sdkman java versions
* docs(advanced-usage): Document support for `.sdkmanrc` as java-version-file
* chore(docs): Anyone can contribute and maintain 🤷
* Update advanced-usage.md
Add example step/file for `.sdkmanrc`
* Update advanced-usage.md
* Update util.ts
* chore: format and rebuild
* chore: untouch toolchains.ts
* fix check dist error
---------
Co-authored-by: mahabaleshwars <147705296+mahabaleshwars@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -601,14 +601,29 @@ steps:
601
601
## Java version file
602
602
If the `java-version-file` input is specified, the action will extract the version from the file and install it.
603
603
604
-
Supported files are .java-version and .tool-versions.
605
-
In .java-version file, only the version should be specified (e.g., 17.0.7).
606
-
In .tool-versions file, java version should be preceded by the java keyword (e.g., java 17.0.7).
607
-
The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv). Similarly, the `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
608
-
609
-
If both java-version and java-version-file inputs are provided, the java-version input will be used.
604
+
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
605
+
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
606
+
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
607
+
* In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
608
+
609
+
610
+
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
611
+
612
+
**Example step using `Sdkman!`**:
613
+
```yml
614
+
- name: Setup java
615
+
uses: actions/setup-java@v5
616
+
with:
617
+
java-version-file: '.sdkmanrc'
618
+
distribution: 'temurin'
619
+
```
620
+
621
+
**Example `.sdkmanrc`**:
622
+
```
623
+
java=17.0.7-tem
624
+
```
610
625
611
-
Valid entry options:
626
+
Valid entry options (does not apply to `.sdkmanrc`):
612
627
```
613
628
major versions: 8, 11, 16, 17, 21
614
629
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
If the file contains multiple versions, only the first one will be recognized.
620
635
621
636
***NOTE***:
622
-
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).
637
+
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).
Copy file name to clipboardExpand all lines: docs/contributors.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,15 +68,15 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
68
68
Adding or changing tests is an integral part of making a change to the code.
69
69
Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml).
70
70
71
-
- The contributor can add various types of tests (like unit tests or end-to-end tests), which, in his opinion, will be necessary and sufficient for testing new or changed functionality
71
+
- The contributor can add various types of tests (like unit tests or end-to-end tests), which, in their opinion, will be necessary and sufficient for testing new or changed functionality
72
72
- Tests should cover a successful execution, as well as some edge cases and possible errors
73
73
- As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request
74
74
75
75
**Once you've filed the pull request:**
76
76
77
77
- CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem
78
78
- Maintainers will review your pull request
79
-
- If a maintainer requests changes, first of all, try to think about his request critically and only after that implement and request another review
79
+
- If a maintainer requests changes, first of all, try to think about their request critically and only after that implement and request another review
80
80
- If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag
81
81
> Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart:
0 commit comments