Skip to content

Commit 98a9442

Browse files
authored
Merge pull request #355 from wakatime/bugfix/build
Build for Intel and Arm
2 parents b0f6e1d + 05a0bd5 commit 98a9442

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/on_push.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: xcodegen
2424
-
2525
name: Build app to run linters
26-
run: xcodebuild -scheme WakaTime
26+
run: xcodebuild -scheme WakaTime -configuration Debug -destination 'generic/platform=macOS' ONLY_ACTIVE_ARCH=NO ARCHS='arm64 x86_64' build
2727

2828
version:
2929
name: Version
@@ -101,12 +101,28 @@ jobs:
101101
name: Build app
102102
id: build
103103
run: |
104-
xcodebuild -scheme WakaTime -configuration Release
104+
xcodebuild -scheme WakaTime -configuration Release -destination 'generic/platform=macOS' ONLY_ACTIVE_ARCH=NO ARCHS='arm64 x86_64' build
105105
app=`find /Users/runner/Library/Developer/Xcode/DerivedData/ -name WakaTime.app`
106106
echo "$app"
107+
lipo -info "$app/Contents/MacOS/WakaTime"
107108
directory=`dirname $app`
108109
echo "$directory"
109110
echo "directory=$directory" >> $GITHUB_OUTPUT
111+
-
112+
name: Verify universal platform
113+
run: |
114+
app=`find /Users/runner/Library/Developer/Xcode/DerivedData/ -name WakaTime.app`
115+
echo "$app"
116+
lipo -info "$app/Contents/MacOS/WakaTime"
117+
BIN="$app/Contents/MacOS/WakaTime"
118+
archs="$(lipo -archs "$BIN" 2>/dev/null || true)"
119+
echo "Reported architectures: $archs"
120+
for required in arm64 x86_64; do
121+
echo "$archs" | grep -qw "$required" || {
122+
echo "❌ Missing required architecture: $required"
123+
exit 1
124+
}
125+
done
110126
-
111127
name: Import Code-Signing Certificates
112128
uses: Apple-Actions/import-codesign-certs@v1

0 commit comments

Comments
 (0)