@@ -46,10 +46,12 @@ function Get-VersionFromRelease {
46
46
function Build-VersionsManifest {
47
47
param (
48
48
[Parameter (Mandatory )][array ]$Releases ,
49
+ [Parameter (Mandatory )][array ]$NoGILReleases ,
49
50
[Parameter (Mandatory )][object ]$Configuration
50
51
)
51
52
52
53
$Releases = $Releases | Sort-Object - Property " published_at" - Descending
54
+ $NoGILReleases = $NoGILReleases | Sort-Object - Property " published_at" - Descending
53
55
$ltsRules = Get-LtsRules - Configuration $Configuration
54
56
55
57
$versionsHash = @ {}
@@ -80,6 +82,42 @@ function Build-VersionsManifest {
80
82
$versionsHash.Add ($versionKey , $versionHash )
81
83
}
82
84
85
+ $noGILversionsHash = @ {}
86
+ foreach ($release in $NoGILReleases ) {
87
+ if (($release.draft -eq $true ) -or ($release.prerelease -eq $true )) {
88
+ continue
89
+ }
90
+
91
+ [Semver ]$version = Get-VersionFromRelease $release
92
+ $versionKey = $version.ToString ()
93
+
94
+ if ($noGILversionsHash.ContainsKey ($versionKey )) {
95
+ continue
96
+ }
97
+
98
+ $ltsStatus = Get-VersionLtsStatus - Version $versionKey - LtsRules $ltsRules
99
+ $stable = $version.PreReleaseLabel ? $false : $true
100
+ [array ]$releaseAssets = $release.assets | Where { $_.Name -ne " hashes.sha256" } | ForEach-Object { New-AssetItem - ReleaseAsset $_ - Configuration $Configuration }
101
+
102
+ $versionHash = [PSCustomObject ]@ {}
103
+ $versionHash | Add-Member - Name " version" - Value $versionKey - MemberType NoteProperty
104
+ $versionHash | Add-Member - Name " stable" - Value $stable - MemberType NoteProperty
105
+ if ($ltsStatus ) {
106
+ $versionHash | Add-Member - Name " lts" - Value $ltsStatus - MemberType NoteProperty
107
+ }
108
+ $versionHash | Add-Member - Name " release_url" - Value $release.html_url - MemberType NoteProperty
109
+ $versionHash | Add-Member - Name " files" - Value $releaseAssets - MemberType NoteProperty
110
+
111
+ if ($versionsHash.ContainsKey ($versionKey )) {
112
+ # filter out filenames already in the versionsHash
113
+ $releaseAssets = $releaseAssets | Where-Object { $versionsHash [$versionKey ].files.filename -notcontains $_.filename }
114
+ $versionsHash [$versionKey ].files += $releaseAssets
115
+ } else {
116
+ $versionsHash.Add ($versionKey , $versionHash )
117
+ }
118
+ $noGILversionsHash.Add ($versionKey , $versionHash )
119
+ }
120
+
83
121
# Sort versions by descending
84
122
return $versionsHash.Values | Sort-Object - Property @ { Expression = { [Semver ]$_.version }; Descending = $true }
85
123
}
0 commit comments