@@ -78,22 +78,52 @@ jobs:
7878 cp src/MLXSharp.Native/runtimes/osx-arm64/native/libmlxsharp.dylib artifacts/native/
7979
8080 - name : Pack MLXSharp library
81- run : dotnet pack src/MLXSharp/MLXSharp.csproj --configuration Release --output artifacts/packages \
82- -p:MLXSharpMacNativeBinary=$GITHUB_WORKSPACE/native/build/libmlxsharp.dylib
81+ run : |
82+ set -euo pipefail
83+ : "${GITHUB_WORKSPACE:=${PWD}}"
84+ MAC_NATIVE_BINARY="${GITHUB_WORKSPACE}/native/build/libmlxsharp.dylib"
85+ echo "Packing MLXSharp with native binary: ${MAC_NATIVE_BINARY}"
86+ dotnet pack \
87+ src/MLXSharp/MLXSharp.csproj \
88+ --configuration Release \
89+ --output artifacts/packages \
90+ "/p:MLXSharpMacNativeBinary=${MAC_NATIVE_BINARY}"
8391
8492 - name : Pack MLXSharp.SemanticKernel library
85- run : dotnet pack src/MLXSharp.SemanticKernel/MLXSharp.SemanticKernel.csproj --configuration Release --output artifacts/packages \
86- -p:MLXSharpMacNativeBinary=$GITHUB_WORKSPACE/native/build/libmlxsharp.dylib
93+ run : |
94+ set -euo pipefail
95+ : "${GITHUB_WORKSPACE:=${PWD}}"
96+ MAC_NATIVE_BINARY="${GITHUB_WORKSPACE}/native/build/libmlxsharp.dylib"
97+ echo "Packing MLXSharp.SemanticKernel with native binary: ${MAC_NATIVE_BINARY}"
98+ dotnet pack \
99+ src/MLXSharp.SemanticKernel/MLXSharp.SemanticKernel.csproj \
100+ --configuration Release \
101+ --output artifacts/packages \
102+ "/p:MLXSharpMacNativeBinary=${MAC_NATIVE_BINARY}"
87103
88104 - name : Verify package contains native libraries
89105 run : |
90106 echo "Checking package contents..."
91- if unzip -l artifacts/packages/*.nupkg | grep -q "runtimes/osx-arm64/native/libmlxsharp.dylib"; then
92- echo "✓ Native library found in package"
93- else
94- echo "✗ ERROR: Native library NOT found in package!"
95- echo "Package contents:"
96- unzip -l artifacts/packages/*.nupkg
107+ shopt -s nullglob
108+ packages=(artifacts/packages/*.nupkg)
109+ if [ ${#packages[@]} -eq 0 ]; then
110+ echo "✗ ERROR: No packages were produced"
111+ exit 1
112+ fi
113+
114+ missing=0
115+ for package in "${packages[@]}"; do
116+ echo "Inspecting ${package}"
117+ if unzip -l "${package}" | grep -q "runtimes/osx-arm64/native/libmlxsharp.dylib"; then
118+ echo " ✓ Native library found"
119+ else
120+ echo " ✗ Native library NOT found"
121+ unzip -l "${package}"
122+ missing=1
123+ fi
124+ done
125+
126+ if [ $missing -ne 0 ]; then
97127 exit 1
98128 fi
99129
0 commit comments