Feature/split yml#15
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors CI packaging by splitting Windows (MSIX + Chocolatey + release) and Snap packaging into reusable GitHub Actions workflows, while adding the supporting packaging assets/scripts committed to the repo.
Changes:
- Added reusable workflows for Windows packaging and Snap packaging, and updated the main Go workflow to call them.
- Added MSIX manifest + icon-resize script to generate required Assets for Windows packaging.
- Added Chocolatey package scaffolding (nuspec + install/uninstall scripts + license/verification templates).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/go.yml |
Replaces inline Windows/Snap packaging steps with reusable workflow calls. |
.github/workflows/windows-packaging.yml |
New reusable workflow to build/sign MSIX, build Chocolatey package, and optionally deploy/release. |
.github/workflows/snap.yml |
New reusable workflow to build/test snap and optionally publish to Snap Store. |
scripts/resize-icons.ps1 |
Generates MSIX icon assets from snap/gui/icon.png. |
packaging/AppxManifest.xml |
Adds committed MSIX manifest used by MakeAppx. |
scripts/VERIFICATION.txt.template |
Template used to generate Chocolatey verification file with commit SHA. |
chocolatey/kemforge.nuspec |
Chocolatey package metadata. |
chocolatey/tools/chocolateyInstall.ps1 |
Chocolatey install script to create kemforge shim. |
chocolatey/tools/chocolateyUninstall.ps1 |
Chocolatey uninstall script to remove kemforge shim. |
chocolatey/tools/LICENSE.txt |
License pointer included in Chocolatey package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| build_installer: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
There was a problem hiding this comment.
build_installer currently runs on every workflow_call, but it includes Azure login + Trusted Signing steps that require repository secrets. Since go.yml triggers on pull_request, this job will fail for PRs (especially from forks) where secrets are unavailable, and it also does unnecessary signing work on non-release builds. Gate the entire build_installer job (or at least the Azure login/sign/install steps) behind inputs.publish_enabled == 'true' && github.ref_name == 'main', while leaving chocobuild always-on as intended.
| foreach ($size in @(44, 48, 150, 256)) { | ||
| $bmp = New-Object System.Drawing.Bitmap $size, $size | ||
| $g = [System.Drawing.Graphics]::FromImage($bmp) | ||
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | ||
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | ||
| $g.DrawImage($sourceIcon, 0, 0, $size, $size) | ||
| $g.Dispose() | ||
| $bmp.Save("packaging/Assets/icon${size}x${size}.png", [System.Drawing.Imaging.ImageFormat]::Png) | ||
| $bmp.Dispose() | ||
| } | ||
|
|
||
| $bmp = New-Object System.Drawing.Bitmap 50, 50 | ||
| $g = [System.Drawing.Graphics]::FromImage($bmp) | ||
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | ||
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | ||
| $g.DrawImage($sourceIcon, 0, 0, 50, 50) | ||
| $g.Dispose() | ||
| $bmp.Save("packaging/Assets/StoreLogo.png", [System.Drawing.Imaging.ImageFormat]::Png) | ||
| $bmp.Dispose() | ||
|
|
||
| $sourceIcon.Dispose() | ||
|
|
There was a problem hiding this comment.
This script manually disposes Image/Graphics/Bitmap, but if an exception occurs mid-loop (e.g., missing source icon, save failure), GDI+ resources can leak and keep file handles open. Wrap the image processing in try/finally (or use using-style patterns) so $g, $bmp, and $sourceIcon are always disposed.
| foreach ($size in @(44, 48, 150, 256)) { | |
| $bmp = New-Object System.Drawing.Bitmap $size, $size | |
| $g = [System.Drawing.Graphics]::FromImage($bmp) | |
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | |
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | |
| $g.DrawImage($sourceIcon, 0, 0, $size, $size) | |
| $g.Dispose() | |
| $bmp.Save("packaging/Assets/icon${size}x${size}.png", [System.Drawing.Imaging.ImageFormat]::Png) | |
| $bmp.Dispose() | |
| } | |
| $bmp = New-Object System.Drawing.Bitmap 50, 50 | |
| $g = [System.Drawing.Graphics]::FromImage($bmp) | |
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | |
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | |
| $g.DrawImage($sourceIcon, 0, 0, 50, 50) | |
| $g.Dispose() | |
| $bmp.Save("packaging/Assets/StoreLogo.png", [System.Drawing.Imaging.ImageFormat]::Png) | |
| $bmp.Dispose() | |
| $sourceIcon.Dispose() | |
| try { | |
| foreach ($size in @(44, 48, 150, 256)) { | |
| $bmp = $null | |
| $g = $null | |
| try { | |
| $bmp = New-Object System.Drawing.Bitmap $size, $size | |
| $g = [System.Drawing.Graphics]::FromImage($bmp) | |
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | |
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | |
| $g.DrawImage($sourceIcon, 0, 0, $size, $size) | |
| $bmp.Save("packaging/Assets/icon${size}x${size}.png", [System.Drawing.Imaging.ImageFormat]::Png) | |
| } | |
| finally { | |
| if ($g) { | |
| $g.Dispose() | |
| } | |
| if ($bmp) { | |
| $bmp.Dispose() | |
| } | |
| } | |
| } | |
| $bmp = $null | |
| $g = $null | |
| try { | |
| $bmp = New-Object System.Drawing.Bitmap 50, 50 | |
| $g = [System.Drawing.Graphics]::FromImage($bmp) | |
| $g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic | |
| $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality | |
| $g.DrawImage($sourceIcon, 0, 0, 50, 50) | |
| $bmp.Save("packaging/Assets/StoreLogo.png", [System.Drawing.Imaging.ImageFormat]::Png) | |
| } | |
| finally { | |
| if ($g) { | |
| $g.Dispose() | |
| } | |
| if ($bmp) { | |
| $bmp.Dispose() | |
| } | |
| } | |
| } | |
| finally { | |
| if ($sourceIcon) { | |
| $sourceIcon.Dispose() | |
| } | |
| } |
Refactored github actions and ensure the chocobuild always runs