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

Allow openjdk/jdk github action api zip #5641

Merged
merged 3 commits into from
Sep 26, 2024
Merged
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
13 changes: 7 additions & 6 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,13 @@ getBinaryOpenjdk()
jdk_files=`ls`
jdk_file_array=(${jdk_files//\\n/ })
last_index=$(( ${#jdk_file_array[@]} - 1 ))

if [[ $last_index == 0 ]]; then
if [[ $download_url =~ '*.tar.gz' ]] || [[ $download_url =~ '*.zip' ]]; then
if [[ $download_url =~ '*.tar.gz' ]] || [[ $download_url =~ '*.zip' ]] || [[ $jdk_files == *.zip ]]; then
nested_zip="${jdk_file_array[0]}"
echo "${nested_zip} is a nested zip"
unzip -q $nested_zip -d .
rm $nested_zip
jdk_files=`ls *jdk*.tar.gz *jre*.tar.gz *testimage*.tar.gz *debugimage*.tar.gz *jdk*.zip *jre*.zip *testimage*.zip *debugimage*.zip 2> /dev/null || true`
jdk_files=$(ls *jdk*.tar.gz *jre*.tar.gz *testimage*.tar.gz *debugimage*.tar.gz *jdk*.zip *jre*.zip *testimage*.zip *debugimage*.zip tests-*.tar.gz symbols-*.tar.gz *static-libs*.tar.gz 2> /dev/null || true)
echo "Found files under ${nested_zip}:"
echo "${jdk_files}"
jdk_file_array=(${jdk_files//\\n/ })
Expand Down Expand Up @@ -345,7 +344,7 @@ getBinaryOpenjdk()
for file_name in "${jdk_file_array[@]}"
do
if [[ ! "$file_name" =~ "sbom" ]]; then
if [[ "$file_name" =~ "debug-image" ]] || [[ "$file_name" =~ "debugimage" ]]; then
if [[ "$file_name" =~ "debug-image" ]] || [[ "$file_name" =~ "debugimage" ]] || [[ "$file_name" =~ "symbols-" ]]; then
# if file_name contains debug-image, extract into j2sdk-image/jre or j2sdk-image dir
# Otherwise, files will be extracted under ./tmp
extract_dir="./j2sdk-image"
Expand Down Expand Up @@ -385,8 +384,10 @@ getBinaryOpenjdk()
len=${#jar_dir_array[@]}
if [ "$len" == 1 ]; then
jar_dir_name=${jar_dir_array[0]}
if [[ "$jar_dir_name" =~ "test-image" ]] && [ "$jar_dir_name" != "openjdk-test-image" ]; then
mv $jar_dir_name ../openjdk-test-image
if [[ "$jar_dir_name" =~ "test-image" ]] || [[ "$jar_dir_name" =~ "tests-" ]]; then
if [ "$jar_dir_name" != "openjdk-test-image" ]; then
mv $jar_dir_name ../openjdk-test-image
fi
elif [[ "$jar_dir_name" =~ jre* ]] && [ "$jar_dir_name" != "j2re-image" ]; then
mv $jar_dir_name ../j2re-image
elif [[ "$jar_dir_name" =~ jdk* ]] && [ "$jar_dir_name" != "j2sdk-image" ]; then
Expand Down