Skip to content
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

[ADOPTIUM] Use Adoptium API instead of GitHub Release API #14

Closed
cimnine opened this issue Sep 4, 2024 · 3 comments
Closed

[ADOPTIUM] Use Adoptium API instead of GitHub Release API #14

cimnine opened this issue Sep 4, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@cimnine
Copy link

cimnine commented Sep 4, 2024

The official Adoptium API can redirect to the respective binary hosted no GitHub, given the Adoptium git tag or major Java version. This would speed up the build, as the release pages don't need to be scrolled, especially in the case that the given version is invalid. It also eliminates GitHub API rate limits for the Adoptium provider.

See https://api.adoptium.net/q/swagger-ui/ for the API spec.

Examples:

$> # Common
$> OS=windows
$> ARCH=x64
$> TYPE=jre
$> IMPL=hotspot
$> HEAP=normal
$> VENDOR=eclipse

$> # Exact Version (git tag in respective GitHub repo)
$> VERSION=jdk-17.0.12+7
$> http "https://api.adoptium.net/v3/binary/version/$VERSION/$OS/$ARCH/$TYPE/$IMPL/$HEAP/$VENDOR"

HTTP/1.1 307 Temporary Redirect
Connection: keep-alive
Content-Length: 0
Date: Wed, 04 Sep 2024 09:03:21 GMT
Location: https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_x64_windows_hotspot_17.0.12_7.zip
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Pod-Hostname: frontend-service-6b96d79d8-bsqj2
content-encoding: identity

$> # Major Version only
$> MAJOR=17
$> http "https://api.adoptium.net/v3/binary/latest/$MAJOR/ga/$OS/$ARCH/$TYPE/$IMPL/$HEAP/$VENDOR"

HTTP/1.1 307 Temporary Redirect
Connection: keep-alive
Content-Length: 0
Date: Wed, 04 Sep 2024 09:04:01 GMT
Location: https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_x64_windows_hotspot_17.0.12_7.zip
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Pod-Hostname: frontend-service-6b96d79d8-l9svf
content-encoding: identity
@raydac
Copy link
Owner

raydac commented Sep 6, 2024

I have added ADOPTIUM_API provider, it can be used for both scenarios

 <configuration>
   <provider>ADOPTIUM_API</provider>
   <providerConfig>
      <arch>x64</arch>
      <featureVersion>17</featureVersion>
      <heapSize>normal</heapSize>
      <imageType>jdk</imageType>
      <jvmImpl>hotspot</jvmImpl>
      <releaseType>ga</releaseType>
      <vendor>eclipse</vendor>
  </providerConfig>
</configuration>
 <configuration>
      <provider>ADOPTIUM_API</provider>
      <providerConfig>
         <arch>x64</arch>
         <releaseName>jdk-21.0.4+7</releaseName>
         <heapSize>normal</heapSize>
         <imageType>jdk</imageType>
         <jvmImpl>hotspot</jvmImpl>
         <vendor>eclipse</vendor>
         <project>jdk</project>
      </providerConfig>
 </configuration>

@raydac raydac self-assigned this Sep 6, 2024
@raydac raydac added the enhancement New feature or request label Sep 6, 2024
@raydac
Copy link
Owner

raydac commented Sep 7, 2024

improved in 1.2.4

@raydac raydac closed this as completed Sep 7, 2024
@cimnine
Copy link
Author

cimnine commented Sep 23, 2024

Thank you, works perfect for my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants