-
Notifications
You must be signed in to change notification settings - Fork 766
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
Added .tool-versions file support #606
Merged
HarithaVattikuti
merged 30 commits into
actions:main
from
mahabaleshwars:add-tool-version-file-support
Mar 12, 2024
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c3eb4ca
Merge pull request #1 from actions/main
mahabaleshwars 7abdf1c
added support for tool version file
mahabaleshwars a7f2ec4
testing with one regex
mahabaleshwars 12fa539
working regex
mahabaleshwars 3ac7f4d
Checked for the file extension
mahabaleshwars 7ac1739
added e2e checks for tool version
mahabaleshwars c2eed4c
removed error warning
mahabaleshwars d6dce30
updated regex to support early version
mahabaleshwars 15bd552
updated regex for early version support
mahabaleshwars 091c706
updated regex for early version
mahabaleshwars 23f648d
updated regex to accept early versions
mahabaleshwars 108d337
added coreinfo to analyze
mahabaleshwars 600bab6
updated the regex
mahabaleshwars 7e1d245
updated regex
mahabaleshwars 7c2ba30
new regex for early version
mahabaleshwars 4963182
updated regex to match the new version file format
mahabaleshwars 5633ed7
new regex
mahabaleshwars 0bd564a
changed the regex
mahabaleshwars dc07897
redex updated
mahabaleshwars ac5ac98
used java version regex
mahabaleshwars 00ea4e3
regex updated
mahabaleshwars 3a44440
regex modified
mahabaleshwars ae1e7f4
regex updated
mahabaleshwars 4ef246e
regex updated
mahabaleshwars 8c268be
regex updated
mahabaleshwars c5831e8
updated regex to support early versions
mahabaleshwars 0d65cda
Regex updated to support all java versions
mahabaleshwars 4253d87
Documentation updated to add tool version description
mahabaleshwars 33cfd28
Documentation updated for the tool version file
mahabaleshwars b71bea4
update the advanced doc and readme file to specify tool version changes
mahabaleshwars File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -525,14 +525,21 @@ steps: | |
something_other | ||
``` | ||
|
||
## 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). | ||
## Java version file | ||
If the `java-version-file` input is specified, the action will extract the version from the file and install it. | ||
|
||
Supported files are .java-version and .tool-versions. | ||
In .java-version file, only the version should be specified, e.g., 17.0.7. | ||
In .tool-versions file, java version should be preceded by the java keyword, e.g., java 17.0.7. | ||
.java-version recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv) and .tool-version recognizes all variants of the version description according to [asdf](https://github.com/asdf-vm/asdf). | ||
|
||
If both java-version and java-version-file inputs are provided, the java-version input will be used. | ||
|
||
Valid entry options: | ||
``` | ||
major versions: 8, 11, 16, 17, 21 | ||
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 | ||
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. 15.0.2-sa.2, 15.2.0+2-sa |
||
early access (EA) versions: 15-ea, 15.0.0-ea | ||
versions with specified distribution: openjdk64-11.0.2 | ||
``` | ||
If the file contains multiple versions, only the first one will be recognized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note that this regex will not accept full java versions commonly generated in
asdf
usinglatest
- eg:...will generate a file with this line:
The regex doesn't recognise this, so
setup-java
will fail with this message:If we play around with the regex, we can see that we have to edit the string down to
java corretto-21.0.2
in order to get it to work: