Skip to content

Commit

Permalink
UB2 Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
taysta committed Nov 5, 2023
1 parent 5f758bb commit 201061b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-universal2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
macos-universal2:
name: macOS ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable}})
runs-on: macos-latest
runs-on: macos-latest-xlarge
strategy:
fail-fast: false
matrix:
Expand All @@ -26,11 +26,11 @@ jobs:
- name: Make build
run: |
chmod +x scripts/universal2/build_universal2.sh
chmod +x scripts/universal2/build_app_bundle.sh
chmod +x scripts/universal2/constants.sh
chmod +x scripts/universal2/sign_and_notarize.sh
./scripts/universal2/build_universal2.sh
chmod +x build-mac-universal2.sh
chmod +x build_app_bundle.sh
chmod +x constants.sh
chmod +x sign_and_notarize.sh
./build-mac-universal2.sh
- name: Create binary archive
if: ${{ matrix.build_type == 'Release' }}
Expand Down
21 changes: 5 additions & 16 deletions build/build-mac-universal2.sh → build-mac-universal2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
cd ..
cd ..

# game/app specific values
export APP_VERSION="1.0"
export ICONSDIR="codemp/macosx"
Expand All @@ -13,31 +10,23 @@ export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"

#constants

source scripts/universal2/constants.sh
source constants.sh

rm -rf "${BUILT_PRODUCTS_DIR}"

#create makefiles with cmake, perform builds with make
export TARGET="arm64-apple-darwin"
export CFLAGS="$CFLAGS --target=$TARGET"
export CXXFLAGS="$CXXFLAGS --target=$TARGET"

rm -rf "${ARM64_BUILD_FOLDER}"
mkdir "${ARM64_BUILD_FOLDER}"
cd "${ARM64_BUILD_FOLDER}" || exit
cmake -A "arm64" -DCMAKE_C_COMPILER_TARGET="$TARGET" -DCMAKE_CXX_COMPILER_TARGET="$TARGET" -DCMAKE_SYSTEM_PROCESSOR="arm64" -DCMAKE_SYSTEM_NAME="Darwin" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DBuildDiscordRichPresence=OFF ../..
cmake -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64 -DUseInternalLibs=ON -DBuildDiscordRichPresence=OFF -DCMAKE_BUILD_TYPE=Release ..
make -j${NCPU}
make install
cd ..

export TARGET="x86_64-apple-darwin"
export CFLAGS="$CFLAGS --target=$TARGET"
export CXXFLAGS="$CXXFLAGS --target=$TARGET"

rm -rf "${X86_64_BUILD_FOLDER}"
mkdir "${X86_64_BUILD_FOLDER}"
cd "${X86_64_BUILD_FOLDER}" || exit
cmake -A "x86_64" -DCMAKE_C_COMPILER_TARGET="$TARGET" -DCMAKE_CXX_COMPILER_TARGET="$TARGET" -DCMAKE_SYSTEM_PROCESSOR="x86_64" -DCMAKE_SYSTEM_NAME="Darwin" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBuildDiscordRichPresence=OFF ../..
cmake -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64 -DUseInternalLibs=ON -DBuildDiscordRichPresence=OFF -DCMAKE_BUILD_TYPE=Release ..
make -j${NCPU}
make install
cd ..
Expand Down Expand Up @@ -66,7 +55,7 @@ echo mv "${ARM64_BUILD_FOLDER}/${EXECUTABLE_FOLDER_PATH}/eternaljk.arm64" "${ARM

# create the app bundle
# since the one reference in the executable is covered we can skip lipo and dylibbundler in this script
"scripts/universal2/build_app_bundle.sh" "skiplipo"
"./build_app_bundle.sh" "skiplipo"

#lipo the executable and libs
lipo "${X86_64_BUILD_FOLDER}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}" "${ARM64_BUILD_FOLDER}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}" -output "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}" -create
Expand Down Expand Up @@ -107,4 +96,4 @@ mkdir "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${ARM64_LIBS_FOLDER}"
cp -a "${ARM64_BUILD_FOLDER}/${EXECUTABLE_FOLDER_PATH}/${ARM64_LIBS_FOLDER}/." "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/${ARM64_LIBS_FOLDER}"

# #sign and notarize
# "scripts/universal2/sign_and_notarize.sh" "$1"
# "../scripts/universal2/sign_and_notarize.sh" "$1"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 201061b

Please sign in to comment.