@@ -147,26 +147,41 @@ jobs:
147
147
run : |
148
148
echo "🔨 Building universal binary..."
149
149
150
- # Build for both architectures
151
- swift build -c release --arch arm64 --arch x86_64
150
+ # Build for arm64
151
+ echo "Building for arm64..."
152
+ swift build -c release --arch arm64
153
+
154
+ # Build for x86_64
155
+ echo "Building for x86_64..."
156
+ swift build -c release --arch x86_64
157
+
158
+ # Find the arm64 executable
159
+ ARM64_PATH=$(find .build -path "*arm64*/release/ClaudeCodeMonitor" -type f | head -1)
160
+ X86_64_PATH=$(find .build -path "*x86_64*/release/ClaudeCodeMonitor" -type f | head -1)
161
+
162
+ if [ -z "$ARM64_PATH" ] || [ -z "$X86_64_PATH" ]; then
163
+ echo "❌ Failed to find one or both architectures"
164
+ echo "ARM64: $ARM64_PATH"
165
+ echo "X86_64: $X86_64_PATH"
166
+ find .build -name ClaudeCodeMonitor -type f
167
+ exit 1
168
+ fi
152
169
153
- # Find the executable
154
- EXECUTABLE_PATH=".build/apple/Products/Release/ClaudeCodeMonitor "
170
+ echo "ARM64 binary: $ARM64_PATH"
171
+ echo "X86_64 binary: $X86_64_PATH "
155
172
156
- # Fallback paths if the primary one doesn't exist
157
- if [ ! -f "$EXECUTABLE_PATH" ]; then
158
- echo "Primary path not found, searching alternatives..."
159
- EXECUTABLE_PATH=$(find .build -name ClaudeCodeMonitor -type f -perm +111 | grep -v '.dSYM' | head -1)
160
- fi
173
+ # Create universal binary
174
+ UNIVERSAL_PATH=".build/universal/release/ClaudeCodeMonitor"
175
+ mkdir -p .build/universal/release
176
+ lipo -create -output "$UNIVERSAL_PATH" "$ARM64_PATH" "$X86_64_PATH"
161
177
162
- if [ -f "$EXECUTABLE_PATH " ]; then
163
- echo "✅ Binary found at: $EXECUTABLE_PATH "
164
- file "$EXECUTABLE_PATH "
165
- lipo -info "$EXECUTABLE_PATH "
166
- echo "EXECUTABLE_PATH=$EXECUTABLE_PATH " >> $GITHUB_ENV
178
+ if [ -f "$UNIVERSAL_PATH " ]; then
179
+ echo "✅ Universal binary created at: $UNIVERSAL_PATH "
180
+ file "$UNIVERSAL_PATH "
181
+ lipo -info "$UNIVERSAL_PATH "
182
+ echo "EXECUTABLE_PATH=$UNIVERSAL_PATH " >> $GITHUB_ENV
167
183
else
168
- echo "❌ Failed to find executable"
169
- find .build -name ClaudeCodeMonitor -type f
184
+ echo "❌ Failed to create universal binary"
170
185
exit 1
171
186
fi
172
187
0 commit comments