Skip to content

Commit dbbdd4f

Browse files
committed
Try to fix test workflow
1 parent 3ca1ec2 commit dbbdd4f

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name:Test
22

33
on:
44
push:
@@ -37,13 +37,13 @@ jobs:
3737
if [[ "${{ runner.os }}" == "macOS" ]]; then
3838
ARCH=$(uname -m)
3939
if [[ "$ARCH" == "arm64" ]]; then RID="osx-arm64"; else RID="osx-x64"; fi
40-
LIB_FILE="ThermoNativeReader.dylib"
40+
LIB_FILE="ThermoNativeReader"
4141
elif [[ "${{ runner.os }}" == "Linux" ]]; then
4242
RID="linux-x64"
43-
LIB_FILE="ThermoNativeReader.so"
43+
LIB_FILE="ThermoNativeReader"
4444
else
4545
RID="win-x64"
46-
LIB_FILE="ThermoNativeReader.dll"
46+
LIB_FILE="ThermoNativeReader.exe"
4747
fi
4848
dotnet publish -r $RID -c Release -p:PublishAot=true
4949
echo "DYLIB_PATH=$(pwd)/bin/Release/net8.0/$RID/publish/$LIB_FILE" >> $GITHUB_ENV

native_fisher_py/python/native_fisher_py/ipc_client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ def get_instance(cls):
4040
return cls._instance
4141

4242
def _start_server(self):
43-
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
43+
pkg_dir = os.path.dirname(os.path.abspath(__file__))
44+
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(pkg_dir))))
4445
native_root = os.path.join(base_dir, "native")
46+
47+
# Binary name depends on platform
48+
bin_name = "ThermoNativeReader.exe" if sys.platform == "win32" else "ThermoNativeReader"
49+
4550
bin_paths = [
46-
os.path.join(native_root, "ThermoNativeReader/bin/Release/net8.0/osx-x64/publish/ThermoNativeReader"),
51+
os.path.join(pkg_dir, bin_name), # Bundled in package
52+
os.path.join(native_root, "ThermoNativeReader/bin/Release/net8.0/osx-x64/publish", bin_name),
53+
os.path.join(native_root, "ThermoNativeReader/bin/Release/net8.0/linux-x64/publish", bin_name),
4754
]
4855

4956
self.bin_path = next((p for p in bin_paths if os.path.exists(p)), None)

0 commit comments

Comments
 (0)