Skip to content

Commit 1ddb758

Browse files
committed
fix: find node artifacts and wire go windows linker
1 parent dfc7f18 commit 1ddb758

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/ci-go.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ jobs:
6969
- name: Build Go bindings
7070
run: |
7171
cd packages/go
72-
$env:LD_LIBRARY_PATH = "$PWD/../../target/release;$env:LD_LIBRARY_PATH"
73-
$env:DYLD_LIBRARY_PATH = "$PWD/../../target/release;$env:DYLD_LIBRARY_PATH"
72+
$ffiPath = "$PWD/../../target/release"
73+
if ($IsWindows) {
74+
$env:PATH = "$ffiPath;$env:PATH"
75+
$env:LIB = "$ffiPath;$env:LIB"
76+
$env:CGO_LDFLAGS = "-L$ffiPath"
77+
} else {
78+
$env:LD_LIBRARY_PATH = "$ffiPath;$env:LD_LIBRARY_PATH"
79+
$env:DYLD_LIBRARY_PATH = "$ffiPath;$env:DYLD_LIBRARY_PATH"
80+
}
7481
go build -v ./...
7582
shell: pwsh
7683

.github/workflows/ci-node.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ jobs:
8686
pnpm install
8787
pnpm exec napi build --platform --release --target ${{ matrix.target }}
8888
mkdir -p artifacts
89-
pnpm exec napi artifacts --output-dir ./artifacts
89+
# Collect artifacts from napi (if produced) and fallback to target outputs.
90+
pnpm exec napi artifacts --output-dir ./artifacts || true
9091
shopt -s nullglob globstar
91-
artifacts=(artifacts/**/*.node)
92+
artifacts=(artifacts/**/*.node target/**/release/*.node)
9293
if [ "${#artifacts[@]}" -eq 0 ]; then
93-
echo "No .node artifacts produced under artifacts/" >&2
94+
echo "No .node artifacts produced under artifacts/ or target/**/release" >&2
9495
exit 1
9596
fi
9697
cp "${artifacts[@]}" .

0 commit comments

Comments
 (0)