From 77735ed6c510279701fbebd0a876bdf2af184fcd Mon Sep 17 00:00:00 2001 From: Arignir Date: Thu, 11 Jan 2024 14:39:31 +0100 Subject: [PATCH] WIP --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 654c54b..0f3c6bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,19 +41,45 @@ jobs: submodules: recursive - name: Install Dependencies run: | - brew install meson ninja sdl2 glew libarchive create-dmg - - name: Build Hades + export BREW_ARM64_ROOT="$(pwd)/brew/arm/" + export BREW_X86_64_ROOT="$(pwd)/brew/x86_64/" + + mkdir -p "$BREW_ARM64_ROOT" "BREW_X86_64_ROOT" + + curl -L https://github.com/Homebrew/brew/tarball/master -o brew.tar.gz + + tar xfz brew.tar.gz --strip 1 -C "$BREW_ARM64_ROOT" + tar xfz brew.tar.gz --strip 1 -C "$BREW_X86_64_ROOT" + + alias brew_arm64='arch -arm64 $BREW_ARM64_ROOT/bin/brew' + alias brew_x86_64='arch -x86_64 $BREW_X86_64_ROOT/bin/brew' + alias brew=false + + brew_x86_64 install meson ninja sdl2 glew libarchive create-dmg + brew_arm64 install meson ninja sdl2 glew libarchive + + - name: Build Hades x86_64 run: | - export PKG_CONFIG_PATH=/usr/local/opt/libarchive/lib/pkgconfig + export PKG_CONFIG_PATH="$BREW_X86_64_ROOT/opt/libarchive/lib/pkgconfig" + + rm -rf /tmp/build/x86_64/ + mkdir -p /tmp/build/x86_64/Hades.app + + arch -x86_64 meson --buildtype=release --prefix=/tmp/build/x86_64/Hades.app --bindir=Contents/MacOS build --werror + arch -x86_64 ninja -C build install - rm -rf /tmp/build/ - mkdir -p /tmp/build/Hades.app + - name: Build Hades Arm64 + run: | + export PKG_CONFIG_PATH="$BREW_ARM64_ROOT/opt/libarchive/lib/pkgconfig" - meson --buildtype=release --prefix=/tmp/build/Hades.app --bindir=Contents/MacOS build --werror - ninja -C build install + rm -rf /tmp/build/arm64/ + mkdir -p /tmp/build/arm64/Hades.app - chmod +x /tmp/build/Hades.app/Contents/MacOS/hades /tmp/build/Hades.app/Contents/MacOS/run.sh + arch -arm64 meson --buildtype=release --prefix=/tmp/build/arm64/Hades.app --bindir=Contents/MacOS build --werror + arch -arm64 ninja -C build install + - name: Build Hades Universal App + run: | echo "Hades dependencies, before fixing:" otool -L /tmp/build/Hades.app/Contents/MacOS/hades echo "End of dependencies" @@ -90,9 +116,10 @@ jobs: otool -L /tmp/build/Hades.app/Contents/MacOS/{hades,*.dylib} echo "End of dependencies" - - name: Test Hades + - name: Test Hades App run: | - /tmp/build/Hades.app/Contents/MacOS/hades --help + arch -x86_64 /tmp/build/Hades.app/Contents/MacOS/hades --help + arch -arm64 /tmp/build/Hades.app/Contents/MacOS/hades --help - name: Sign Hades App # Only run if a certificate is set @@ -121,7 +148,7 @@ jobs: MACOS_CODESIGN_CRT_PWD: ${{ secrets.MACOS_CODESIGN_CRT_PWD }} MACOS_CODESIGN_CRT_IDENTITY: ${{ secrets.MACOS_CODESIGN_CRT_IDENTITY }} - - name: Pack Hades + - name: Create Hades DMG run: | rm -rf Hades.dmg