From aa801c2c17d212181b3260b5273d602e4396b3d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 21:35:15 +0000 Subject: [PATCH] Make artifact names clickable, use human-readable file sizes, and add rar to compression formats Agent-Logs-Url: https://github.com/cmderdev/cmder/sessions/ce43a069-b966-4141-b4e1-3d201bc3ddbf Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com> --- .github/workflows/build.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bd4d11..3fed9d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,10 +174,25 @@ jobs: ### 🗃️ Artifacts - | Artifact | Size | Download | Hash (SHA256) | - | --- | --- | --- | --- | + | Artifact | Size | Hash (SHA256) | + | --- | --- | --- | "@ + # Function to format file size in human-readable format + function Format-FileSize { + param([double]$Bytes) + + if ($Bytes -ge 1GB) { + return "{0:N2} GiB" -f ($Bytes / 1GB) + } elseif ($Bytes -ge 1MB) { + return "{0:N2} MiB" -f ($Bytes / 1MB) + } elseif ($Bytes -ge 1KB) { + return "{0:N2} KiB" -f ($Bytes / 1KB) + } else { + return "{0:N0} B" -f $Bytes + } + } + # Function to get artifact download URL with retry logic function Get-ArtifactDownloadUrl { param( @@ -216,7 +231,7 @@ jobs: foreach ($file in $buildFiles) { $artifact = $file.Name $path = $file.FullName - $size = $file.Length / 1MB + $sizeFormatted = Format-FileSize -Bytes $file.Length $hash = (Get-FileHash $path -Algorithm SHA256).Hash # Try to get the actual artifact download URL @@ -232,13 +247,13 @@ jobs: # Determine emoji based on file type if ($artifact -match '\.txt$') { $emoji = "📄" - } elseif ($artifact -match '\.(zip|7z)$') { + } elseif ($artifact -match '\.(zip|rar|7z)$') { $emoji = "🗄️" } else { $emoji = "📦" } - $summary += "`n| $emoji ``$artifact`` | $([math]::Round($size, 2)) MB | [📥 Download$warning]($downloadUrl) | ``$hash`` |" + $summary += "`n| $emoji [``$artifact``$warning]($downloadUrl) | $sizeFormatted | ``$hash`` |" } } $summary += "`n"