Skip to content

Explicitly set the LATEST_VERSION of Java we build #113

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ readonly VARIANTS=(
graalvm21
)

readonly LATEST_VERSION="24"

# Use buildkit to match CI as closely as possible.
export DOCKER_BUILDKIT=1

Expand All @@ -44,23 +46,6 @@ function compute_metadata() {
GIT_HEAD_REF="$(git show-ref --head --hash ^HEAD)"
}

function compute_latest_version() {
# Java versions are typically released towards the end of the month in March and September,
# so we use the version from the previous release cycle until the month after the release.
local base_year=2025
local base_version=23

version="$((base_version + ($(date +%Y) - base_year) * 2))"
if [ "$(date +%m)" -ge 4 ]; then
version="$((version + 1))"
fi
if [ "$(date +%m)" -ge 10 ]; then
version="$((version + 1))"
fi

export LATEST_VERSION="$version"
}

# docker build wrapper with common arguments
# See https://github.com/opencontainers/image-spec/blob/main/annotations.md for common labels
# See https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
Expand Down Expand Up @@ -88,7 +73,6 @@ function image_name() {

function do_build() {
compute_metadata
compute_latest_version
docker_build base "$(image_name base)"
docker_build full "$(image_name latest)"
if [ -n "${GITHUB_OUTPUT+unset}" ]; then
Expand Down