melonDS/.github/workflows/build-macos-universal.yml

87 lines
2.8 KiB
YAML
Raw Normal View History

name: CMake Build (macOS Universal)
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
prepare:
runs-on: [self-hosted, macOS, ARM64]
steps:
2022-08-31 16:53:09 +00:00
- name: Clean workspace
2022-08-31 16:56:18 +00:00
run: rm -rf ${{runner.workspace}}/build
- uses: actions/checkout@v3
build-arm64:
2022-08-31 16:56:18 +00:00
needs: prepare
runs-on: [self-hosted, macOS, ARM64]
2022-08-31 17:06:19 +00:00
env:
homebrew_prefix: /opt/homebrew
steps:
- name: Create build directory
2022-08-31 16:57:31 +00:00
run: mkdir -p ${{runner.workspace}}/build/arm64
2023-10-07 14:44:27 +00:00
- name: INSTALL ENET
run: |
arch -arm64 brew update
arch -arm64 brew install enet
- name: Configure
working-directory: ${{runner.workspace}}/build/arm64
2022-08-31 17:26:36 +00:00
run: arch -arm64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
- name: Make
working-directory: ${{runner.workspace}}/build/arm64
run: arch -arm64 make -j$(sysctl -n hw.logicalcpu)
build-x86_64:
2022-08-31 16:56:18 +00:00
needs: prepare
runs-on: [self-hosted, macOS, ARM64]
2022-08-31 17:06:19 +00:00
env:
homebrew_prefix: /usr/local
steps:
- name: Create build directory
2022-08-31 16:57:31 +00:00
run: mkdir -p ${{runner.workspace}}/build/x86_64
2023-10-07 14:44:27 +00:00
- name: INSTALL ENET
run: |
arch -x86_64 brew update
arch -x86_64 brew install enet
- name: Configure
working-directory: ${{runner.workspace}}/build/x86_64
2022-08-31 17:26:36 +00:00
run: arch -x86_64 ${{env.homebrew_prefix}}/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="${{env.homebrew_prefix}}/opt/qt@6;${{env.homebrew_prefix}}/opt/libarchive" -DPKG_CONFIG_EXECUTABLE=${{env.homebrew_prefix}}/bin/pkg-config -DMACOS_BUNDLE_LIBS=ON -DUSE_QT6=ON
- name: Make
working-directory: ${{runner.workspace}}/build/x86_64
run: arch -x86_64 make -j$(sysctl -n hw.logicalcpu)
universal-binary:
2022-08-31 16:56:18 +00:00
needs: [build-arm64, build-x86_64]
runs-on: [self-hosted, macOS, ARM64]
steps:
- name: Merge binaries
run: $GITHUB_WORKSPACE/tools/mac-universal.py ${{runner.workspace}}/build/arm64/melonDS.app ${{runner.workspace}}/build/x86_64/melonDS.app ${{runner.workspace}}/build/universal/melonDS.app
- name: Codesign app
run: codesign -s - --deep -f ${{runner.workspace}}/build/universal/melonDS.app
- name: Create DMG
run: hdiutil create -fs HFS+ -volname melonDS -srcfolder ${{runner.workspace}}/build/universal/melonDS.app -ov -format UDBZ ${{runner.workspace}}/build/universal/melonDS.dmg
- uses: actions/upload-artifact@v3
with:
name: macOS-universal
path: ${{runner.workspace}}/build/universal/melonDS.dmg