Skip to content

Commit cd44ecb

Browse files
authored
Merge pull request #27 from K9i-0/fix/github-actions-build-errors
fix(ci): GitHub Actionsのビルドエラーを修正
2 parents 45575bf + 4cd362e commit cd44ecb

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Verify binary architecture
2727
run: |
28-
file .build/*/release/ClaudeUsageMonitor
28+
file .build/*/release/ClaudeCodeMonitor
2929
echo "Build completed successfully"
3030
3131
test:

.github/workflows/release.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,41 @@ jobs:
147147
run: |
148148
echo "🔨 Building universal binary..."
149149
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
152169
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"
155172
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"
161177
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
167183
else
168-
echo "❌ Failed to find executable"
169-
find .build -name ClaudeCodeMonitor -type f
184+
echo "❌ Failed to create universal binary"
170185
exit 1
171186
fi
172187

0 commit comments

Comments
 (0)