Skip to content

Commit 517508a

Browse files
committed
Change version to 25.1.0-SNAPSHOT, update script to download the EA bundle
1 parent 54d32bd commit 517508a

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<properties>
1010
<!-- NOTE: revision is special and one can change it from cmd line: `mvn -Drevision=... package` -->
1111
<!-- See https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html -->
12-
<revision>26.0.0-SNAPSHOT</revision>
12+
<revision>25.1.0-SNAPSHOT</revision>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1515
<project.polyglot.version>${revision}</project.polyglot.version>

scripts/maven-bundle-url.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ project_root="$( cd -P "$( dirname "$source" )/.." && pwd )"
1414

1515
revision="$(mvn -f "${project_root}/pom.xml" help:evaluate -Dexpression=revision -q -DforceStdout)"
1616
revision="${revision%-SNAPSHOT}" # remove -SNAPSHOT
17-
revision_quoted_for_jq="${revision//./\\\\.}"
1817

1918
echo "Trying to find the release for revision: ${revision}"
2019
curl -sSL "https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/releases" -o github_releases.json
@@ -23,12 +22,28 @@ echo "Downloaded releases JSON from GitHub, head:"
2322
head -n 20 github_releases.json
2423
echo "==========================================="
2524

26-
asset_url=$(cat github_releases.json \
27-
| jq -r 'map(select(.tag_name | test("'${revision_quoted_for_jq}'"))) | max_by(.published_at) | .assets[] | select(.name | test("^maven-resource-.*\\.zip$")) | .browser_download_url')
25+
# Find the newest maven-resource-bundle ZIP whose name contains the desired revision.
26+
# Scan all releases and their assets, guard against nulls, and pick the latest by published_at.
27+
asset_url=$(
28+
jq -r --arg rev "$revision" '
29+
[ .[] as $rel
30+
| ($rel.assets // [])[]
31+
| select(
32+
(.name | startswith("maven-resource-bundle-")) and
33+
(.name | contains($rev)) and
34+
(.name | endswith(".zip"))
35+
)
36+
| {published_at: $rel.published_at, url: .browser_download_url}
37+
]
38+
| sort_by(.published_at)
39+
| last?
40+
| .url // empty
41+
' github_releases.json
42+
)
2843

2944
rm github_releases.json
3045
if [[ -z "$asset_url" ]]; then
31-
echo "Failed to find a maven-resource-bundle zip" >&2
46+
echo "Failed to find a maven-resource-bundle zip for revision ${revision}" >&2
3247
exit 1
3348
fi
3449
echo $asset_url

0 commit comments

Comments
 (0)