@@ -55,120 +55,24 @@ jobs:
5555 run : |
5656 echo "Building for Apple Silicon (arm64)..."
5757 swift build --configuration release --arch arm64
58- mkdir -p build-artifacts/arm64
59- cp .build/release/swiftmac build-artifacts/arm64/
60- cp -r .build/release/ogg.framework build-artifacts/arm64/
61- cp -r .build/release/vorbis.framework build-artifacts/arm64/
62- echo "Saved arm64 build artifacts"
63- file build-artifacts/arm64/swiftmac
64-
65- - name : Clean build directory
66- run : |
67- echo "Cleaning build directory..."
68- rm -rf .build
69-
70- - name : Build for Intel (x86_64)
71- run : |
72- echo "Building for Intel (x86_64)..."
73- swift build --configuration release --arch x86_64
74- mkdir -p build-artifacts/x86_64
75- cp .build/release/swiftmac build-artifacts/x86_64/
76- cp -r .build/release/ogg.framework build-artifacts/x86_64/
77- cp -r .build/release/vorbis.framework build-artifacts/x86_64/
78- echo "Saved x86_64 build artifacts"
79- file build-artifacts/x86_64/swiftmac
80-
81- - name : Create Universal Binary
82- run : |
83- echo "Creating universal binary..."
84-
85- # Verify source binaries
86- echo "ARM64 binary:"
87- file build-artifacts/arm64/swiftmac
88- lipo -info build-artifacts/arm64/swiftmac
89-
90- echo "x86_64 binary:"
91- file build-artifacts/x86_64/swiftmac
92- lipo -info build-artifacts/x86_64/swiftmac
93-
94- # Create universal binary for swiftmac executable
95- lipo -create \
96- build-artifacts/arm64/swiftmac \
97- build-artifacts/x86_64/swiftmac \
98- -output swiftmac-universal
99-
100- # Verify it's universal
101- echo "Universal binary:"
102- file swiftmac-universal
103- lipo -info swiftmac-universal
104-
105- # Check framework architectures
106- mkdir -p universal-frameworks
107-
108- echo ""
109- echo "Checking ogg.framework architectures..."
110- echo "ARM64 version:"
111- lipo -info build-artifacts/arm64/ogg.framework/ogg || true
112- echo "x86_64 version:"
113- lipo -info build-artifacts/x86_64/ogg.framework/ogg || true
114-
115- # Handle ogg framework - check if architectures differ
116- ARM_OGG_ARCH=$(lipo -info build-artifacts/arm64/ogg.framework/ogg 2>&1 | grep -o 'arm64\|x86_64' | head -1)
117- X86_OGG_ARCH=$(lipo -info build-artifacts/x86_64/ogg.framework/ogg 2>&1 | grep -o 'arm64\|x86_64' | head -1)
118-
119- if [ "$ARM_OGG_ARCH" = "$X86_OGG_ARCH" ]; then
120- echo "ogg.framework has same architecture in both builds, using as-is"
121- cp -r build-artifacts/arm64/ogg.framework universal-frameworks/
122- else
123- echo "Creating universal ogg.framework"
124- cp -r build-artifacts/arm64/ogg.framework universal-frameworks/
125- lipo -create \
126- build-artifacts/arm64/ogg.framework/ogg \
127- build-artifacts/x86_64/ogg.framework/ogg \
128- -output universal-frameworks/ogg.framework/ogg
129- fi
130-
131- echo ""
132- echo "Checking vorbis.framework architectures..."
133- echo "ARM64 version:"
134- lipo -info build-artifacts/arm64/vorbis.framework/vorbis || true
135- echo "x86_64 version:"
136- lipo -info build-artifacts/x86_64/vorbis.framework/vorbis || true
137-
138- # Handle vorbis framework - check if architectures differ
139- ARM_VORBIS_ARCH=$(lipo -info build-artifacts/arm64/vorbis.framework/vorbis 2>&1 | grep -o 'arm64\|x86_64' | head -1)
140- X86_VORBIS_ARCH=$(lipo -info build-artifacts/x86_64/vorbis.framework/vorbis 2>&1 | grep -o 'arm64\|x86_64' | head -1)
141-
142- if [ "$ARM_VORBIS_ARCH" = "$X86_VORBIS_ARCH" ]; then
143- echo "vorbis.framework has same architecture in both builds, using as-is"
144- cp -r build-artifacts/arm64/vorbis.framework universal-frameworks/
145- else
146- echo "Creating universal vorbis.framework"
147- cp -r build-artifacts/arm64/vorbis.framework universal-frameworks/
148- lipo -create \
149- build-artifacts/arm64/vorbis.framework/vorbis \
150- build-artifacts/x86_64/vorbis.framework/vorbis \
151- -output universal-frameworks/vorbis.framework/vorbis
152- fi
15358
154- # Verify final frameworks
155- echo ""
156- echo "Final framework architectures:"
157- lipo -info universal-frameworks/ogg.framework/ogg
158- lipo -info universal-frameworks/vorbis.framework/vorbis
59+ # Verify architecture
60+ echo "Verifying swiftmac binary:"
61+ file .build/release/swiftmac
62+ lipo -info .build/release/swiftmac
15963
16064 - name : Create release archive
16165 run : |
16266 VERSION="${{ needs.check-version.outputs.version }}"
163- echo "Building swiftmac version $VERSION (Universal Binary )"
67+ echo "Building swiftmac version $VERSION (Apple Silicon only )"
16468
16569 # Create release directory
16670 mkdir -p swiftmac
16771
168- # Copy universal binary and frameworks
169- cp swiftmac-universal swiftmac/swiftmac
170- cp -rf universal-frameworks /ogg.framework swiftmac/
171- cp -rf universal-frameworks /vorbis.framework swiftmac/
72+ # Copy arm64 binary and frameworks
73+ cp .build/release/ swiftmac swiftmac/
74+ cp -rf .build/release /ogg.framework swiftmac/
75+ cp -rf .build/release /vorbis.framework swiftmac/
17276
17377 # Copy support files
17478 cp swiftmac-voices.el swiftmac/
0 commit comments