-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos-universal-binary.sh
More file actions
executable file
·29 lines (23 loc) · 1.35 KB
/
macos-universal-binary.sh
File metadata and controls
executable file
·29 lines (23 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#################################################################################################################################
# macos-universal-binary.sh
# Created on 03/27/2025
#
# Copyright (C) 2025 Mehmet Bertan Tarakcioglu, Under the MIT License
#
# This file was originally created as part of the WatchDuck project CI Pipeline.
#################################################################################################################################
# This script is meant to run on a GitHub macOS Action Runner as part of the Swift-Executable-CI workflows!
# It assumes to be part of the workflow and may fail if it is being run by itself.
# This script combines macOS build binaries and generates a singel universal binary in its own build directory.
# Exit bash script on error
set -eo pipefail
# Create a new directory to contain the universal binary build
mkdir -p ".build/macos-universal/release"
# Create universal binary
lipo -create ".build/arm64-apple-macosx/release/"${EXEC_NAME}"" ".build/x86_64-apple-macosx/release/"${EXEC_NAME}"" \
-output ".build/macos-universal/release/"${EXEC_NAME}""
# Copy the universal binary and its bundle to its new home!
if [ -n "$(find .build/arm64-apple-macosx/release/ -name '*.bundle' 2>/dev/null)" ]; then
cp -r ".build/arm64-apple-macosx/release/"*.bundle ".build/macos-universal/release"
fi