-
Notifications
You must be signed in to change notification settings - Fork 746
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
Add Support for JetBrains Runtime #637
Conversation
- Add Installer, Models - Includes Tests & Test Manifest Data - Add to `e2e-versions.yml` - Run `npm run build` - Update README.md
I'm using your branch as a workaround # TODO: replace this once https://github.com/actions/setup-java/pull/637 gets merged.
- uses: gmitch215/setup-java@07ea605e4b1f0f8b0621155fb1722d6094c3e183
with:
distribution: 'jetbrains'
java-version: 17 with an error: Installed distributions
Error: No supported distribution was found for input jetbrains is there anything I can do? See: |
Hmm, I'll debug and get back here later. |
Seems I just forgot to add it to the map of recognized runtimes to their IDs. Update your commit hash and it should succeed. My project passed with the following configuration: - name: Setup JBR 17
uses: gmitch215/setup-java@7f3ab2648f3d20faa20c4fe6e52a455757e0f38a
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle' |
It could be picked correctly now! But seems some libs are missing in this JDK installed. Execution failed for task ':checkRuntime'.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
> Failed to check JDK distribution: 'jlink', 'jpackage' are missing
JDK distribution path: /Users/runner/hostedtoolcache/Java_JetBrains_jdk/17.0.11-1312.2/arm64/Contents/Home See https://github.com/Goooler/kotlin-explorer/actions/runs/9575738587/job/26401058613. |
The JDK installed by Gradle
Seems we need |
I switched the URL to the ones listed in the |
I guessed correctly! - name: Setup JBR 17
uses: gmitch215/setup-java@99fc2135f7f7b08068e180cb5f29340f9de70720
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle' (This action failed due to below) Note: Running on |
99fc213 works for me now, someone who needs this can ref romainguy/kotlin-explorer#62. Thanks for your quick response! |
Got - name: Setup JBR 17
uses: gmitch215/setup-java@e1f4c15facc0cf68c0e764340e374be034e4a859
with:
distribution: 'jetbrains'
java-version: 17
cache: 'gradle' |
Thank you @gmitch215, I'm using your branch as a workaround too and can confirm it works fine! |
On a relatively complex workflow with a fan-out setup and composite actions that parallelize builds I get rate limit failures from time to time:
Is there something that can be done in this action's implementation or on my side? |
@eskatos The JetBrains Your best bet is to do something that changes the IP (not sure if re-running it manually does this, but worth a shot). Unless someone knows how the runner could provide authentication. Edit: This error page is about the GitHub API, which is something I need to add. However, the above is still true. Edit 2: Done. - name: Setup JBR 21
uses: gmitch215/setup-java@b4d76a354bef7187244f74eea4e80e674a7b4b55
with:
distribution: 'jetbrains'
java-version: 21
cache: 'gradle' |
Re-running did make the job pass indeed.
Thank you for fixing this! |
With b4d76a3 I'm getting this:
|
@eskatos I forgot GitHub doesn't automatically inject the The action should now check if it is provided. Update to this: - name: Setup JBR 21
uses: gmitch215/setup-java@6d2c5e1f82f180ae79f799f0ed6e3e5efb4e664d
with:
distribution: 'jetbrains'
java-version: 21
cache: 'gradle'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
I am a little confused. Are you saying
JetBrains seems to have removed |
Hi @gmitch215, could you please confirm if you are working on updating the documentation to include information about the valid input for JDK 11? |
Yes, currently working on new fixes. |
hello, I use jewel in my project, which requires jbrsdk+jcef but I see that jbr doesn't have jpackage, so when I use ./gradlew packageDmg, I get an error! Failed to check JDK distribution: 'jpackage' is missing |
You can use |
@aparnajyothi-y @mahabaleshwars Documentation is updated and hidden versions were added. |
how to configure this ‘package-type’ |
Maybe I didn't make my question clear to you, you can look here JetBrains/jewel#709 |
- name: Setup JBR 21
uses: gmitch215/setup-java@main
with:
distribution: 'jetbrains'
java-version: 21
cache: 'gradle'
java-package: 'jdk+jcef'
# For GitHub API (use if you believe you'd run into rate limits)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
ok, thank you |
@gmitch215 its package-type or java-package? Unexpected input(s) 'package-type', valid inputs are ['java-version', 'java-version-file', 'distribution', 'java-package', 'architecture', 'jdkFile', 'check-latest', 'server-id', 'server-username', 'server-password', 'settings-path', 'overwrite-settings', 'gpg-private-key', 'gpg-passphrase', 'cache', 'cache-dependency-path', 'job-status', 'token', 'mvn-toolchain-id', 'mvn-toolchain-vendor'] |
That's correct, my bad. |
Hello @gmitch215, Thanks again for the continuous improvements to the PR! The latest changes addressing the issue with JDK 11.0.10 and the documentation look great. However, I’ve noticed a couple of things that still need attention: There are some CI failures that can be fixed by running the command: Regarding the JDK version input, the documentation mentions that versions are based on the GitHub tags on the JetBrains Runtime releases page, with both underscores (11_0_13) and dots (11.0.13) supported. While the dot format is encouraged for consistency, both are valid. That said, when the input for JDK 11 contains underscores, it is still failing. I see that you've already addressed this, but could you please take another look to see if there’s something we might have missed? I’ve attached a screenshot for reference. Thanks again for your work on this! |
@mahabaleshwars Availability between using That being said, I notice some tags do exist with underscore notation ( Thank you all for moving this forward! |
Dot notation is enforced by the base installer, so underscore support is not possible. Updated the documentation to reflect this and fixed a typo. Also ran |
Once again, |
Hello @gmitch215, CI workflow issues are fixed now and this should address the issues in this PR. Please sync the main branch with setup-java. |
@mahabaleshwars Done. |
Current Workaround
Description:
This PR adds support for the JetBrains Runtime, which is required in dependencies like jewel and useful for Compose Multiplatform.
The PR uses the binaries listed in
Binaries for Developers
, using theJBRSDK
flavor as shown in the releases page for the default flavorjdk
. Alternative flavors includejdk+jcef
andjdk+ft
withjre
counterparts.It uses the GitHub API to find and parse versions, then calculates the URL using
cache-redirector.jetbrains.com
with the parsed SemVer, OS, Arch, and build number, which all output a.tar.gz
file. Left a few comments in there for maintainability. Some tags have inconsistent naming conventions, or have been removed from public view for various reasons, so it will filter out those versions.Since this uses the GitHub API, you can optionally specify a
GITHUB_TOKEN
environmental variable to increase your rate limit.Related issue:
Check list:
Notes
Tested using
jetbrains-installer.test.ts
. Most of the tests were copied from other installers, but some I couldn't figure out how to bring over, so additional work may be required. I also copieddownloadTool
from the Temurin installer.I also executed
npm run build
fordist/setup/index.js
. I think something else was also thrown because I was on TypeScript 5.3, so I'm not sure how that will affectncc
.