Skip to content

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

@cimnine

Description

@cimnine

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions