build(wix): an installer for Windows

An MSI for Windows built with WiX and `cargo wix`, for x86_64 and aarch64,
attached to every release and, on tags, offered to winget. It is its own
product: its upgrade code and the GUID of its PATH component are new, since
reusing komorebi's would make the two installers upgrade and uninstall each
other.

WiX only runs on Windows, so `tests/packaging.rs` checks what a Mac can: every
binary the crate builds is in the installer, and the installer is not
komorebi's.
This commit is contained in:
LGUG2Z committed 2026-10-27 22:22:56 -07:00
1 parent 928ee8ebaa
commit ab0b943ba0
6 files changed
+290 -2

No files matched your search

+17
View File
@@ -108,12 +108,17 @@ jobs:
command: "build"
target: ${{ matrix.platform.target }}
args: "--locked --release"
- shell: pwsh
run: |
cargo install cargo-wix
cargo wix --no-build -p komorebi-recorder --nocapture -I .\wix\main.wxs --target ${{ matrix.platform.target }}
- uses: actions/upload-artifact@v7
with:
name: komorebi-recorder-${{ matrix.platform.target }}-${{ github.sha }}
path: |
target/${{ matrix.platform.target }}/release/*.exe
target/${{ matrix.platform.target }}/release/*.pdb
target/wix/komorebi-recorder-*.msi
retention-days: 14
# Packages what the two builds made and publishes it. What kind of publication depends on the
@@ -153,8 +158,11 @@ jobs:
zip -j "dist/komorebi-recorder-${VERSION}-aarch64-apple-darwin.zip" \
"komorebi-recorder-aarch64-apple-darwin-${GITHUB_SHA}/komorebi-recorder"
for triple in x86_64-pc-windows-msvc aarch64-pc-windows-msvc; do
arch="${triple%%-*}"
zip -j "dist/komorebi-recorder-${VERSION}-${triple}.zip" \
"komorebi-recorder-${triple}-${GITHUB_SHA}/${triple}/release/"*.exe
cp "komorebi-recorder-${triple}-${GITHUB_SHA}/wix/"*"-${arch}.msi" \
"dist/komorebi-recorder-${VERSION}-${arch}.msi"
done
(cd dist && shasum -a 256 -- * > checksums.txt)
- name: Write the release notes
@@ -202,3 +210,12 @@ jobs:
dist/* ;;
esac
winget:
if: github.repository == 'LGUG2Z/komorebi-recorder' && startsWith(github.ref, 'refs/tags/v')
needs: publish
runs-on: ubuntu-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@main
with:
identifier: LGUG2Z.komorebi-recorder
token: ${{ secrets.WINGET_TOKEN }}