Skip to content

Feature/split yml#15

Merged
DaanAcohen merged 2 commits intomainfrom
feature/split-yml
Mar 27, 2026
Merged

Feature/split yml#15
DaanAcohen merged 2 commits intomainfrom
feature/split-yml

Conversation

@DaanAcohen
Copy link
Copy Markdown
Member

Refactored github actions and ensure the chocobuild always runs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +12 to +16
build_installer:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5

Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread scripts/resize-icons.ps1
Comment on lines +7 to +28
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()

Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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()
}
}

Copilot uses AI. Check for mistakes.
@DaanAcohen DaanAcohen merged commit 1a26989 into main Mar 27, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants