1
0
forked from GRIN/grim

ci(windows): build a WiX .msi installer, like GRIM (not just a bare exe zip)

GRIM ships a Windows .msi; we were only zipping goblin.exe. The Windows release
job now runs cargo-wix against wix/main.wxs (the cargo-wix default template:
WixUI_Minimal + launch-after-install), producing a proper installer whose
shortcuts and Add/Remove-Programs entry carry wix/Product.ico — the yellow
Goblin icon. WiX 3 is taken from the runner or installed via choco; --no-build
reuses the release exe so the embedded GOBLIN_BUILD number is preserved. We
upload BOTH the .msi and the portable .zip (matching GRIM). Windows-only change.
This commit is contained in:
2ro
2026-06-17 08:48:01 -04:00
parent 1fdbd80282
commit 2b5cb8ad55
+24 -1
View File
@@ -66,7 +66,28 @@ jobs:
- name: Build
shell: bash
run: GOBLIN_BUILD="${TAG#build}" cargo build --release
- name: Package
- name: Build MSI installer (cargo-wix / WiX 3 — same packaging as GRIM)
shell: pwsh
run: |
# The .msi is built from wix/main.wxs (the cargo-wix default template:
# WixUI_Minimal + launch-after-install), so `cargo wix` wires up the
# WixUI/WixUtil extensions, cultures and CargoTargetBinDir for us. The
# installer + shortcuts + Add/Remove-Programs entry carry wix/Product.ico
# (the yellow Goblin icon). --no-build reuses the release exe above so the
# embedded GOBLIN_BUILD number is preserved.
cargo install cargo-wix --locked
$wix = Get-ChildItem 'C:\Program Files (x86)' -Directory -Filter 'WiX Toolset v3*' -ErrorAction SilentlyContinue | Select-Object -Last 1
if (-not $wix) {
choco install wixtoolset --no-progress -y | Out-Null
$wix = Get-ChildItem 'C:\Program Files (x86)' -Directory -Filter 'WiX Toolset v3*' | Select-Object -Last 1
}
$env:WIX = "$($wix.FullName)\"
$env:PATH = "$($wix.FullName)\bin;$env:PATH"
$msi = "goblin-$env:TAG-win-x86_64.msi"
cargo wix --no-build --nocapture -o "$msi"
if ($LASTEXITCODE -ne 0 -or -not (Test-Path "$msi")) { throw "cargo wix failed to produce $msi" }
(Get-FileHash "$msi" -Algorithm SHA256).Hash.ToLower() + " $msi" | Out-File -Encoding ascii "goblin-$env:TAG-win-x86_64-msi-sha256sum.txt"
- name: Package portable zip
shell: bash
run: |
7z a "goblin-$TAG-win-x86_64.zip" ./target/release/goblin.exe
@@ -75,6 +96,8 @@ jobs:
with:
tag_name: ${{ inputs.tag || github.event.release.tag_name }}
files: |
goblin-${{ inputs.tag || github.event.release.tag_name }}-win-x86_64.msi
goblin-${{ inputs.tag || github.event.release.tag_name }}-win-x86_64-msi-sha256sum.txt
goblin-${{ inputs.tag || github.event.release.tag_name }}-win-x86_64.zip
goblin-${{ inputs.tag || github.event.release.tag_name }}-win-x86_64-sha256sum.txt