3131 - name : Install CMake
3232 run : brew install cmake
3333
34+ - name : Build native stub library
35+ run : |
36+ cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
37+ cmake --build native/build --target mlxsharp --config Release
38+ mkdir -p src/MLXSharp.Native/runtimes/osx-arm64/native
39+ cp native/build/libmlxsharp.dylib src/MLXSharp.Native/runtimes/osx-arm64/native/
40+ echo "Native library built:"
41+ ls -la src/MLXSharp.Native/runtimes/osx-arm64/native/
42+
43+ - name : Rebuild solution with native libraries
44+ run : dotnet build MLXSharp.sln --configuration Release --no-restore
45+
3446 - name : Setup Python for HuggingFace
3547 uses : actions/setup-python@v5
3648 with :
4658 echo "Model files:"
4759 ls -la models/Qwen1.5-0.5B-Chat-4bit/
4860
49- - name : Build native stub library
50- run : |
51- cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
52- cmake --build native/build --target mlxsharp --config Release
53- mkdir -p src/MLXSharp.Native/runtimes/osx-arm64/native
54- cp native/build/libmlxsharp.dylib src/MLXSharp.Native/runtimes/osx-arm64/native/
55-
56- - name : Rebuild with native libraries
57- run : dotnet build MLXSharp.sln --configuration Release --no-restore
58-
5961 - name : Copy native library to test output
6062 run : |
6163 TEST_OUTPUT="src/MLXSharp.Tests/bin/Release/net9.0"
@@ -76,10 +78,12 @@ jobs:
7678 cp src/MLXSharp.Native/runtimes/osx-arm64/native/libmlxsharp.dylib artifacts/native/
7779
7880 - name : Pack MLXSharp library
79- run : dotnet pack src/MLXSharp/MLXSharp.csproj --configuration Release --output artifacts/packages
81+ run : dotnet pack src/MLXSharp/MLXSharp.csproj --configuration Release --output artifacts/packages \
82+ -p:MLXSharpMacNativeBinary=$GITHUB_WORKSPACE/native/build/libmlxsharp.dylib
8083
8184 - name : Pack MLXSharp.SemanticKernel library
82- run : dotnet pack src/MLXSharp.SemanticKernel/MLXSharp.SemanticKernel.csproj --configuration Release --output artifacts/packages
85+ run : dotnet pack src/MLXSharp.SemanticKernel/MLXSharp.SemanticKernel.csproj --configuration Release --output artifacts/packages \
86+ -p:MLXSharpMacNativeBinary=$GITHUB_WORKSPACE/native/build/libmlxsharp.dylib
8387
8488 - name : Verify package contains native libraries
8589 run : |
0 commit comments