Skip to content
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
14 changes: 13 additions & 1 deletion tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ function Get-PackageDependencies
# than the build version and we know that older versions just works.
#
$MinICUVersion = 60 # runtime minimum supported
$BuildICUVersion = 76 # current build version
$BuildICUVersion = Get-IcuLatestRelease
$MaxICUVersion = $BuildICUVersion + 30 # headroom

if ($Distribution -eq 'deb') {
Expand Down Expand Up @@ -5808,3 +5808,15 @@ function Test-IsProductFile {

return $false
}

# Get major version from latest ICU release (latest: stable version)
function Get-IcuLatestRelease {
$response = Invoke-WebRequest -Uri "https://github.com/unicode-org/icu/releases/latest"
$tagUrl = ($response.Links | Where-Object href -like "*releases/tag/release-*")[0].href

if ($tagUrl -match 'release-(\d+)\.') {
return [int]$Matches[1]
}

throw "Unable to determine the latest ICU release version."
}
Loading