diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e585ab2..21a7f04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable + - name: Bootstrap libsimplex on Windows + if: runner.os == 'Windows' + shell: powershell + run: ./scripts/bootstrap-simplex-windows.ps1 # enable this ci template to run regardless of whether the lockfile is checked in or not - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' diff --git a/scripts/bootstrap-simplex-windows.ps1 b/scripts/bootstrap-simplex-windows.ps1 index c66e8f9..af3e71e 100644 --- a/scripts/bootstrap-simplex-windows.ps1 +++ b/scripts/bootstrap-simplex-windows.ps1 @@ -13,7 +13,11 @@ if (-not [Environment]::Is64BitOperatingSystem) { function Install-GhcupEnvironment { Write-Host "Installing missing GHCup/MSYS2 components..." $bootstrap = Invoke-WebRequest "https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1" -UseBasicParsing - & ([ScriptBlock]::Create($bootstrap.Content)) -Minimal -InBash -Msys2Env UCRT64 -DontWriteDesktopShortcuts + $bootstrapContent = $bootstrap.Content + if ($bootstrapContent -is [byte[]]) { + $bootstrapContent = [Text.Encoding]::UTF8.GetString($bootstrapContent) + } + & ([ScriptBlock]::Create([string] $bootstrapContent)) -Minimal -InBash -Msys2Env UCRT64 -DontWriteDesktopShortcuts } $Ghcup = Get-Command ghcup.exe -ErrorAction SilentlyContinue