@@ -41,87 +41,16 @@ jobs:
4141 exit 1
4242 }
4343
44- # Get all .NET versions from the releases index
45- # - Include .NET Core 3.1 and all .NET 5+ versions
44+ # Get supported .NET versions from the releases index
45+ # - Only active support-phase channels (3.0+)
4646 # - Exclude legacy .NET Core 1.x and 2.x versions (not supported by this project)
47- $allVersions = $releasesIndex.'releases-index' | Where-Object {
48- $_.'channel-version' -match '^\d+\.\d+$' -and
49- [int]($_.'channel-version' -split '\.')[0] -ge 3
50- }
51-
52- $supportedVersions = $allVersions | Where-Object { $_.'support-phase' -eq 'active' } | Sort-Object { [int]($_.'channel-version' -split '\.')[0] }
53- $eolVersions = $allVersions | Where-Object { $_.'support-phase' -eq 'eol' }
47+ $supportedVersions = $releasesIndex.'releases-index' | Where-Object {
48+ $_.'channel-version' -match '^\d+\.\d+$' -and
49+ [int]($_.'channel-version' -split '\.')[0] -ge 3 -and
50+ $_.'support-phase' -eq 'active'
51+ } | Sort-Object { [int]($_.'channel-version' -split '\.')[0] }
5452
5553 Write-Host "Supported .NET versions: $($supportedVersions.'channel-version' -join ', ')"
56- Write-Host "End-of-life .NET versions: $($eolVersions.'channel-version' -join ', ')"
57-
58- # Read ExampleSetup.iss file for EOL version removal
59- $exampleSetupContent = Get-Content -Path "ExampleSetup.iss" -Raw
60- $eolMarkedVersions = @()
61-
62- # Process EOL versions - mark as EOL in README, keep in code, remove from examples
63- foreach ($versionInfo in $eolVersions) {
64- $channel = $versionInfo.'channel-version'
65- $major = [int]($channel -split '\.')[0]
66- $minor = [int]($channel -split '\.')[1]
67-
68- Write-Host "`nProcessing EOL .NET $channel to mark as EOL..."
69-
70- # Determine the procedure name patterns based on version
71- # .NET Core 3.1 uses "NetCore31", .NET 5+ uses "DotNet{major}0"
72- if ($major -eq 3 -and $minor -eq 1) {
73- $procNameBase = "NetCore31"
74- $versionLabel = ".NET Core 3.1"
75- } else {
76- $procNameBase = "DotNet${major}0"
77- $versionLabel = ".NET ${major}.0"
78- }
79-
80- # Check if procedures exist in CodeDependencies.iss
81- $runtimeProcPattern = "procedure Dependency_Add${procNameBase};"
82- if ($issContent -match [regex]::Escape($runtimeProcPattern)) {
83- Write-Host "Found $versionLabel procedures in CodeDependencies.iss - keeping but marking as EOL in README..."
84-
85- # Escape channel for use in regex patterns
86- $escapedChannel = [regex]::Escape($channel)
87-
88- # Define base pattern for matching .NET version entries in README
89- $basePattern = "\.NET (Core )?${escapedChannel}(\.\d+)? \(Runtime, ASP\.NET, Desktop\)"
90-
91- # Check if already marked as EOL in README
92- $eolPattern = "\* ${basePattern} - \*\*EOL\*\*"
93- $notEolPattern = "(\* ${basePattern})(?! - \*\*EOL\*\*)"
94-
95- if ($readmeContent -match $eolPattern) {
96- Write-Host "$versionLabel already marked as EOL in README.md"
97- } elseif ($readmeContent -match $notEolPattern) {
98- # Add EOL marker to existing entry
99- # Note: In PowerShell, `$1 uses backtick (`) to escape $ and reference the first capture group
100- $readmeContent = $readmeContent -replace $notEolPattern, "`$1 - EOL"
101- Write-Host "Marked $versionLabel as EOL in README.md"
102- $updatesFound = $true
103- $eolMarkedVersions += $versionLabel
104- } else {
105- Write-Host "$versionLabel not found in README.md - may need to be added as EOL"
106- }
107-
108- # Comment out EOL version calls in ExampleSetup.iss with EOL marker for discoverability
109- # Keep them in the example so users can discover they exist for legacy applications
110- # This handles both uncommented and already-commented EOL lines, ensuring consistent format
111- # Use a loop to avoid code duplication
112- $suffixes = @("", "Asp", "Desktop")
113- foreach ($suffix in $suffixes) {
114- # Pattern only matches lines with no comment or existing EOL comments, preserving other inline comments
115- $pattern = "(?m)^(\s*)(?://)?Dependency_Add${procNameBase}${suffix};(?:\s*//\s*EOL.*)?$"
116- $replacement = "`${1}//Dependency_Add${procNameBase}${suffix}; // EOL"
117- $exampleSetupContent = $exampleSetupContent -replace $pattern, $replacement
118- }
119-
120- Write-Host "Kept $versionLabel in CodeDependencies.iss, marked as EOL in README.md, commented out in ExampleSetup.iss"
121- } else {
122- Write-Host "$versionLabel not found in CodeDependencies.iss - already removed or not present"
123- }
124- }
12554
12655 # Process each supported version
12756 foreach ($versionInfo in $supportedVersions) {
@@ -177,36 +106,42 @@ jobs:
177106 $desktopFiles = @()
178107
179108 if ($latestRelease.runtime -and $latestRelease.runtime.files) {
180- $runtimeFiles = $latestRelease.runtime.files | Where-Object { $_.name -match "win-(x86|x64)\.exe$" }
109+ $runtimeFiles = $latestRelease.runtime.files | Where-Object { $_.name -match "win-(x86|x64|arm64 )\.exe$" }
181110 } else {
182111 Write-Warning ".NET $channel runtime files not found in API response"
183112 }
184-
113+
185114 if ($latestRelease.'aspnetcore-runtime' -and $latestRelease.'aspnetcore-runtime'.files) {
186- $aspNetFiles = $latestRelease.'aspnetcore-runtime'.files | Where-Object { $_.name -match "win-(x86|x64)\.exe$" }
115+ $aspNetFiles = $latestRelease.'aspnetcore-runtime'.files | Where-Object { $_.name -match "win-(x86|x64|arm64 )\.exe$" }
187116 } else {
188117 Write-Warning ".NET $channel ASP.NET Core runtime files not found in API response"
189118 }
190-
119+
191120 if ($latestRelease.'windowsdesktop' -and $latestRelease.'windowsdesktop'.files) {
192- $desktopFiles = $latestRelease.'windowsdesktop'.files | Where-Object { $_.name -match "win-(x86|x64)\.exe$" }
121+ $desktopFiles = $latestRelease.'windowsdesktop'.files | Where-Object { $_.name -match "win-(x86|x64|arm64 )\.exe$" }
193122 } else {
194123 Write-Warning ".NET $channel Windows Desktop runtime files not found in API response"
195124 }
196125
197126 $runtimeX86 = ($runtimeFiles | Where-Object { $_.name -match "win-x86\.exe$" }).url
198127 $runtimeX64 = ($runtimeFiles | Where-Object { $_.name -match "win-x64\.exe$" }).url
128+ $runtimeArm64 = ($runtimeFiles | Where-Object { $_.name -match "win-arm64\.exe$" }).url
199129 $aspNetX86 = ($aspNetFiles | Where-Object { $_.name -match "win-x86\.exe$" }).url
200130 $aspNetX64 = ($aspNetFiles | Where-Object { $_.name -match "win-x64\.exe$" }).url
131+ $aspNetArm64 = ($aspNetFiles | Where-Object { $_.name -match "win-arm64\.exe$" }).url
201132 $desktopX86 = ($desktopFiles | Where-Object { $_.name -match "win-x86\.exe$" }).url
202133 $desktopX64 = ($desktopFiles | Where-Object { $_.name -match "win-x64\.exe$" }).url
134+ $desktopArm64 = ($desktopFiles | Where-Object { $_.name -match "win-arm64\.exe$" }).url
203135
204136 Write-Host "Runtime x86: $runtimeX86"
205137 Write-Host "Runtime x64: $runtimeX64"
138+ Write-Host "Runtime arm64: $runtimeArm64"
206139 Write-Host "ASP.NET x86: $aspNetX86"
207140 Write-Host "ASP.NET x64: $aspNetX64"
141+ Write-Host "ASP.NET arm64: $aspNetArm64"
208142 Write-Host "Desktop x86: $desktopX86"
209143 Write-Host "Desktop x64: $desktopX64"
144+ Write-Host "Desktop arm64: $desktopArm64"
210145
211146 # Update version checks - Runtime
212147 $issContent = $issContent -replace `
@@ -243,6 +178,11 @@ jobs:
243178 "https://[^']+dotnet-runtime-$major\.0\.$currentPatch-win-x64\.exe", `
244179 $runtimeX64
245180 }
181+ if ($runtimeArm64) {
182+ $issContent = $issContent -replace `
183+ "https://[^']+dotnet-runtime-$major\.0\.$currentPatch-win-arm64\.exe", `
184+ $runtimeArm64
185+ }
246186
247187 if ($aspNetX86 -and $aspNetX64) {
248188 $issContent = $issContent -replace `
@@ -252,6 +192,11 @@ jobs:
252192 "https://[^']+aspnetcore-runtime-$major\.0\.$currentPatch-win-x64\.exe", `
253193 $aspNetX64
254194 }
195+ if ($aspNetArm64) {
196+ $issContent = $issContent -replace `
197+ "https://[^']+aspnetcore-runtime-$major\.0\.$currentPatch-win-arm64\.exe", `
198+ $aspNetArm64
199+ }
255200
256201 if ($desktopX86 -and $desktopX64) {
257202 $issContent = $issContent -replace `
@@ -261,6 +206,11 @@ jobs:
261206 "https://[^']+windowsdesktop-runtime-$major\.0\.$currentPatch-win-x64\.exe", `
262207 $desktopX64
263208 }
209+ if ($desktopArm64) {
210+ $issContent = $issContent -replace `
211+ "https://[^']+windowsdesktop-runtime-$major\.0\.$currentPatch-win-arm64\.exe", `
212+ $desktopArm64
213+ }
264214
265215 } else {
266216 Write-Host ".NET $major.0 is up to date"
@@ -308,18 +258,12 @@ jobs:
308258 # Write the updated content back to the files
309259 [System.IO.File]::WriteAllText("CodeDependencies.iss", $issContent)
310260 [System.IO.File]::WriteAllText("README.md", $readmeContent)
311- [System.IO.File]::WriteAllText("ExampleSetup.iss", $exampleSetupContent)
312261
313262 # Set outputs for the next step
314263 $summaryText = $updateSummary -join ", "
315- $eolText = $eolMarkedVersions -join ", "
316264 "updates_found=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
317265 "summary=$summaryText" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
318- "eol=$eolText" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
319266 Write-Host "Updates found: $summaryText"
320- if ($eolMarkedVersions.Count -gt 0) {
321- Write-Host "EOL versions marked: $eolText"
322- }
323267 } else {
324268 "updates_found=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
325269 Write-Host "No updates found"
@@ -330,8 +274,8 @@ jobs:
330274 uses : peter-evans/create-pull-request@v7
331275 with :
332276 token : ${{ secrets.GITHUB_TOKEN }}
333- commit-message : " Update to .NET ${{ steps.check-updates.outputs.summary }}${{ steps.check-updates.outputs.eol && format(' | Marked EOL: {0}', steps.check-updates.outputs.eol) || '' }} "
334- title : " Update to .NET ${{ steps.check-updates.outputs.summary }}${{ steps.check-updates.outputs.eol && format(' | Marked EOL: {0}', steps.check-updates.outputs.eol) || '' }} "
277+ commit-message : " Update to .NET ${{ steps.check-updates.outputs.summary }}"
278+ title : " Update to .NET ${{ steps.check-updates.outputs.summary }}"
335279 body : |
336280 This PR updates the following .NET runtime dependencies:
337281 .NET ${{ steps.check-updates.outputs.summary || 'No version updates' }}
0 commit comments