[ubuntu] Refactor functions for GitHub assets and hashes (#9040)

This commit is contained in:
Shamil Mubarakshin
2023-12-25 19:47:58 +01:00
committed by GitHub
parent 08d10be70d
commit 694536d87f
15 changed files with 149 additions and 114 deletions

View File

@@ -8,11 +8,11 @@
source $HELPER_SCRIPTS/install.sh
KOTLIN_ROOT="/usr/share"
download_url=$(resolve_github_release_asset_url "JetBrains/kotlin" "contains(\"kotlin-compiler\")" "latest")
download_url=$(resolve_github_release_asset_url "JetBrains/kotlin" "contains(\"kotlin-compiler\") and endswith(\".zip\")" "latest")
archive_path=$(download_with_retry "$download_url")
# Supply chain security - Kotlin
kotlin_hash=$(get_github_package_hash "JetBrains" "kotlin" "kotlin-compiler-.*\.zip" "" "latest" "false" "|" 3)
kotlin_hash=$(get_checksum_from_github_release "JetBrains/kotlin" "kotlin-compiler-.*\.zip" "latest" "SHA256")
use_checksum_comparison "$archive_path" "$kotlin_hash"
unzip -qq "$archive_path" -d $KOTLIN_ROOT