Skip to content

Commit 9089add

Browse files
robertmetaclaude
andcommitted
Build universal binaries for Intel and Apple Silicon
Update GitHub Actions workflow to create universal binaries: - Build separately for arm64 (Apple Silicon) and x86_64 (Intel) - Use lipo to combine into universal binary - Create universal frameworks for ogg and vorbis - Verify all binaries support both architectures Release tarballs now contain universal binaries that work on: - Intel Macs (x86_64) - Apple Silicon Macs (M1, M2, M3, etc. - arm64) Documentation updated to reflect universal binary support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
1 parent 6cf83f4 commit 9089add

2 files changed

Lines changed: 58 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,68 @@ jobs:
5151
- name: Set up Swift
5252
uses: swift-actions/setup-swift@v2
5353

54-
- name: Build release version
55-
run: swift build --configuration release
54+
- name: Build for Apple Silicon (arm64)
55+
run: |
56+
echo "Building for Apple Silicon (arm64)..."
57+
swift build --configuration release --arch arm64
58+
mkdir -p .build/arm64-apple-macosx/release
59+
cp -r .build/release/* .build/arm64-apple-macosx/release/
60+
61+
- name: Build for Intel (x86_64)
62+
run: |
63+
echo "Building for Intel (x86_64)..."
64+
swift build --configuration release --arch x86_64
65+
mkdir -p .build/x86_64-apple-macosx/release
66+
cp -r .build/release/* .build/x86_64-apple-macosx/release/
67+
68+
- name: Create Universal Binary
69+
run: |
70+
echo "Creating universal binary..."
71+
72+
# Create universal binary for swiftmac executable
73+
lipo -create \
74+
.build/arm64-apple-macosx/release/swiftmac \
75+
.build/x86_64-apple-macosx/release/swiftmac \
76+
-output swiftmac-universal
77+
78+
# Verify it's universal
79+
file swiftmac-universal
80+
lipo -info swiftmac-universal
81+
82+
# Create universal frameworks by copying arm64 structure and merging binaries
83+
mkdir -p universal-frameworks
84+
85+
# OggDecoder framework
86+
cp -r .build/arm64-apple-macosx/release/ogg.framework universal-frameworks/
87+
lipo -create \
88+
.build/arm64-apple-macosx/release/ogg.framework/ogg \
89+
.build/x86_64-apple-macosx/release/ogg.framework/ogg \
90+
-output universal-frameworks/ogg.framework/ogg
91+
92+
# Vorbis framework
93+
cp -r .build/arm64-apple-macosx/release/vorbis.framework universal-frameworks/
94+
lipo -create \
95+
.build/arm64-apple-macosx/release/vorbis.framework/vorbis \
96+
.build/x86_64-apple-macosx/release/vorbis.framework/vorbis \
97+
-output universal-frameworks/vorbis.framework/vorbis
98+
99+
# Verify frameworks are universal
100+
echo "Verifying universal frameworks..."
101+
lipo -info universal-frameworks/ogg.framework/ogg
102+
lipo -info universal-frameworks/vorbis.framework/vorbis
56103
57104
- name: Create release archive
58105
run: |
59106
VERSION="${{ needs.check-version.outputs.version }}"
60-
echo "Building swiftmac version $VERSION"
107+
echo "Building swiftmac version $VERSION (Universal Binary)"
61108
62109
# Create release directory
63110
mkdir -p swiftmac
64111
65-
# Copy binary and frameworks
66-
cp -rf .build/release/ogg.framework swiftmac/
67-
cp -rf .build/release/vorbis.framework swiftmac/
68-
cp .build/release/swiftmac swiftmac/
112+
# Copy universal binary and frameworks
113+
cp swiftmac-universal swiftmac/swiftmac
114+
cp -rf universal-frameworks/ogg.framework swiftmac/
115+
cp -rf universal-frameworks/vorbis.framework swiftmac/
69116
70117
# Copy support files
71118
cp swiftmac-voices.el swiftmac/

Readme.org

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,14 @@ When you update the version in =Sources/SwiftMacPackage/main.swift= and push to
338338
*** What Gets Included in Releases
339339

340340
The release tarball (=swiftmac-VERSION.tar.gz=) includes:
341-
- =swiftmac= binary (release build)
342-
- =ogg.framework= and =vorbis.framework=
341+
- =swiftmac= universal binary (works on both Intel and Apple Silicon Macs)
342+
- =ogg.framework= and =vorbis.framework= (universal frameworks)
343343
- =swiftmac-voices.el=
344344
- =cloud-swiftmac= and =log-swiftmac= scripts
345345
- Documentation: =LICENSE=, =Readme.org=, =Readme.emacspeak.org=
346346

347+
*Note:* All binaries are universal, containing both x86_64 (Intel) and arm64 (Apple Silicon) code.
348+
347349
** Hacking
348350
:PROPERTIES:
349351
:CUSTOM_ID: hacking

0 commit comments

Comments
 (0)