Skip to content

Commit 89c812e

Browse files
authored
[ci] Add universal mac builds (#289)
1 parent 971847d commit 89c812e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/main.yml

+47
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,53 @@ jobs:
221221
name: chocolatey
222222
path: extra/chocolatey/pack/
223223

224+
mac-universal:
225+
name: mac universal
226+
needs: [mac-build]
227+
runs-on: macos-latest
228+
229+
env:
230+
INPUT_AMD64: mac-static-amd64-binaries
231+
INPUT_ARM64: mac-static-arm64-binaries
232+
OUTPUT: mac-static-universal-binaries
233+
234+
steps:
235+
- name: Download ${{ env.INPUT_AMD64 }}
236+
uses: actions/download-artifact@v4
237+
with:
238+
name: ${{ env.INPUT_AMD64 }}
239+
path: ${{ env.INPUT_AMD64 }}
240+
241+
- name: Download ${{ env.INPUT_ARM64 }}
242+
uses: actions/download-artifact@v4
243+
with:
244+
name: ${{ env.INPUT_ARM64 }}
245+
path: ${{ env.INPUT_ARM64 }}
246+
247+
- name: Create universal binaries
248+
run: |
249+
mkdir $OUTPUT
250+
251+
# put amd64 files straight into output to make sure all non-binary files are also included
252+
tar -xf $INPUT_AMD64/neko-*.tar.gz \
253+
-C $OUTPUT --strip-components=1
254+
tar -xf $INPUT_ARM64/neko-*.tar.gz \
255+
-C $INPUT_ARM64 --strip-components=1
256+
257+
for filename in $OUTPUT/{*.ndll,libneko.*.*.*.dylib,neko,nekoc,nekoml,nekotools}; do
258+
filename_amd64=$filename
259+
filename_arm64=${filename/$OUTPUT/$INPUT_ARM64}
260+
lipo -create -output $filename $filename_amd64 $filename_arm64
261+
done
262+
263+
file $OUTPUT/*
264+
265+
- name: Upload universal binaries
266+
uses: actions/upload-artifact@v4
267+
with:
268+
name: ${{ env.OUTPUT }}
269+
path: ${{ env.OUTPUT }}
270+
224271
deploy-s3:
225272
name: deploy s3
226273
needs: [windows-build, package-choco, mac-build, linux-build]

0 commit comments

Comments
 (0)