From 5974fa32d022f6bfcf18d9dacdd3c2c9113b1a45 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Fri, 13 Feb 2026 00:25:37 +0100 Subject: [PATCH] windows: Add installer build For distribution of Radicle on Windows machines, Windows Installer provides a well-known solution, that comes built in to the operating system. It also integrates with the Windows package manager WinGet. Provide an initial version of an `*.msi` build, and integrate it into GitHub actions to allow downloads via build artifacts. --- .github/workflows/build.yml | 17 +++++++++- windows/.gitignore | 2 ++ windows/Package.wxs | 62 +++++++++++++++++++++++++++++++++++++ windows/README.md | 17 ++++++++++ windows/Radicle.wixproj | 5 +++ windows/version.ps1 | 20 ++++++++++++ 6 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 windows/.gitignore create mode 100644 windows/Package.wxs create mode 100644 windows/README.md create mode 100644 windows/Radicle.wixproj create mode 100644 windows/version.ps1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1236d6e0..e9b0e5fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 + with: + fetch-depth: 512 + fetch-tags: true + filter: 'tree:0' - uses: dtolnay/rust-toolchain@stable - uses: actions/cache@v4 with: @@ -30,6 +34,17 @@ jobs: path: target key: ${{ matrix.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }}-cargo-target - run: cargo build --workspace --verbose --all-features + - if: runner.os == 'Windows' + working-directory: windows + run: | + $env:RADICLE_VERSION = "$(.\version.ps1)" + echo $env:RADICLE_VERSION + dotnet build + - if: runner.os == 'Windows' + uses: actions/upload-artifact@v4 + with: + name: radicle-installer-${{ runner.arch }}-${{ github.sha }}-${{ github.job }} + path: windows/bin/*/*.msi - if: runner.os != 'Windows' run: cargo test --workspace --verbose --all-features -- --nocapture - if: runner.os == 'Windows' diff --git a/windows/.gitignore b/windows/.gitignore new file mode 100644 index 00000000..1746e326 --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,2 @@ +bin +obj diff --git a/windows/Package.wxs b/windows/Package.wxs new file mode 100644 index 00000000..15650687 --- /dev/null +++ b/windows/Package.wxs @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/README.md b/windows/README.md new file mode 100644 index 00000000..d37c3ac8 --- /dev/null +++ b/windows/README.md @@ -0,0 +1,17 @@ +# Radicle for Windows + +## Prerequisites + +### Code-Signing + +For `signtool.exe`, install [Windows SDK]. + +### WiX Toolset + +Requires [.NET] SDK in version 6.0 or higher. +See [WiX Toolset Tutorial]. + + +[Windows SDK]: https://learn.microsoft.com/windows/apps/windows-sdk/downloads +[WiX Toolset Tutorial]: https://docs.firegiant.com/wix/tutorial/ +[.NET]: https://dotnet.microsoft.com/download/dotnet/ \ No newline at end of file diff --git a/windows/Radicle.wixproj b/windows/Radicle.wixproj new file mode 100644 index 00000000..f7175d8b --- /dev/null +++ b/windows/Radicle.wixproj @@ -0,0 +1,5 @@ + + + ICE91 + + \ No newline at end of file diff --git a/windows/version.ps1 b/windows/version.ps1 new file mode 100644 index 00000000..e497104c --- /dev/null +++ b/windows/version.ps1 @@ -0,0 +1,20 @@ +$prefix = "releases" + +$describe = git describe --match "$prefix/*.*.*" --exclude "$prefix/*.*.*-*.*" --candidates=1 2>$null +if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($describe)) { + Write-Error -Category ObjectNotFound "tag not found" + exit 1 +} + +if (-not ($describe.Trim() -match "^$prefix/(\d+)\.(\d+)\.(\d+)(?:-(\d+)-g[0-9a-f]+)?$")) { + Write-Error -Category ParserError "tag not recognized" + exit 1 +} + +$major = [int]$matches[1] +$minor = [int]$matches[2] +$patch = [int]$matches[3] + +$commits = if ([string]::IsNullOrEmpty($matches[4])) { 0 } else { [int]$matches[4] } + +Write-Output "$major.$minor.$patch.$commits"