diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..ac2b23f --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5625850..240a089 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,3 +82,29 @@ jobs: $env:LEXMOUNT_BROWSER_CLI_INSTALL_DIR = Join-Path $env:RUNNER_TEMP "browser-cli-bootstrap" & .\skills\lexmount-browser\scripts\bootstrap.ps1 & (Join-Path $env:LEXMOUNT_BROWSER_CLI_INSTALL_DIR "browser-cli.exe") version + + windows-release: + runs-on: windows-latest + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + - run: cargo test --locked --target x86_64-pc-windows-msvc + - run: cargo build --release --locked --target x86_64-pc-windows-msvc + - name: Verify standalone Windows executable + shell: powershell + run: | + $binary = "target/x86_64-pc-windows-msvc/release/browser-cli.exe" + & $binary version + if ($LASTEXITCODE -ne 0) { throw "browser-cli version failed with exit code $LASTEXITCODE" } + + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $installationPath = & $vswhere -latest -property installationPath + Import-Module "$installationPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" + Enter-VsDevShell -VsInstallPath $installationPath -SkipAutomaticLocation + $dependencies = & dumpbin.exe /dependents $binary + $dependencies | Write-Output + if ($dependencies -match '(?im)^\s+(?:VCRUNTIME|MSVCP)\d*[^\s]*\.dll\s*$') { + throw "Windows release dynamically depends on the Visual C++ Redistributable" + }