Sorting releases and taking latest (#4703)

This commit is contained in:
Maksim Shilov
2021-12-09 18:39:44 +03:00
committed by GitHub
parent 8a7123162f
commit 5f872f77d6

View File

@@ -8,7 +8,9 @@ source $HELPER_SCRIPTS/install.sh
KOTLIN_ROOT="/usr/share"
URL=$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))')
kotlinReleasesUrl="https://api.github.com/repos/JetBrains/kotlin/releases"
latestRelease=$(curl -s $kotlinReleasesUrl | jq -r 'map(select(.prerelease == false)) | sort_by(.target_commitish)[-1]')
URL=$(echo $latestRelease | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))')
download_with_retries $URL "/tmp"
unzip -qq /tmp/kotlin-compiler*.zip -d $KOTLIN_ROOT