Skip to content

Commit 502ddfa

Browse files
committed
fix(ci): avoid duplicate node copy and ensure msvc bin on PATH
1 parent 9cb6aa2 commit 502ddfa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/ci-go.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,16 @@ jobs:
7575
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
7676
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
7777
if (-not $vsPath) { throw "MSVC not found via vswhere" }
78+
$msvcRoot = Get-ChildItem -Directory -Path (Join-Path $vsPath "VC\Tools\MSVC") | Sort-Object Name -Descending | Select-Object -First 1
79+
if (-not $msvcRoot) { throw "MSVC tools not found under $vsPath" }
80+
$binPath = Join-Path $msvcRoot.FullName "bin\Hostx64\x64"
7881
$vcvars = Join-Path $vsPath "VC\Auxiliary\Build\vcvars64.bat"
7982
$envOutput = cmd /c "`"$vcvars`" ^&^& set"
8083
foreach ($line in $envOutput) {
8184
$parts = $line -split '=',2
8285
if ($parts.Length -eq 2) { [Environment]::SetEnvironmentVariable($parts[0], $parts[1]) }
8386
}
84-
$env:PATH = "$ffiPath;$env:PATH"
87+
$env:PATH = "$binPath;$ffiPath;$env:PATH"
8588
$env:LIB = "$ffiPath;$env:LIB"
8689
$env:CGO_LDFLAGS = "-L$ffiPath -lkreuzberg_ffi"
8790
$env:CGO_CFLAGS = "-I$workspace/crates/kreuzberg-ffi"

.github/workflows/ci-node.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ jobs:
9595
find . -maxdepth 4 -type f -name "*.node" || true
9696
exit 1
9797
fi
98-
cp "${artifacts[@]}" .
98+
for f in "${artifacts[@]}"; do
99+
dest="./$(basename "$f")"
100+
if [ "$f" != "$dest" ]; then
101+
cp "$f" "$dest"
102+
fi
103+
done
99104
pnpm exec napi prepublish -t npm --no-gh-release
100105
pnpm pack
101106

0 commit comments

Comments
 (0)