diff options
author | Rayyan Ansari <rayyan@ansari.sh> | 2022-08-31 17:46:57 +0100 |
---|---|---|
committer | Rayyan Ansari <rayyan@ansari.sh> | 2022-08-31 17:50:03 +0100 |
commit | d1dbb1f51ecc50fa7d01ae002b267b6f93cb223f (patch) | |
tree | 87bb186bdb2ddc4752cfe1e77331b8618c289717 /.github/workflows | |
parent | ce68e883c473730ceed1d0c41e05399d9a5f9217 (diff) |
Add self-hosted macOS ARM64 Universal Binary runner
Adds a workflow file for building a universal binary with a self hosted runner.
Also adds a Python script to assist with creating the universal binary
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build-macos-universal.yml | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/build-macos-universal.yml b/.github/workflows/build-macos-universal.yml new file mode 100644 index 0000000..b4ad1a6 --- /dev/null +++ b/.github/workflows/build-macos-universal.yml @@ -0,0 +1,65 @@ +name: CMake Build (macOS Universal) + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + prepare: + runs-on: [self-hosted, macOS, ARM64] + + steps: + - uses: AutoModality/action-clean@v1 + + - uses: actions/checkout@v3 + + + build-arm64: + runs-on: [self-hosted, macOS, ARM64] + + steps: + - name: Create build directory + run: mkdir ${{runner.workspace}}/build/arm64 + + - name: Configure + working-directory: ${{runner.workspace}}/build/arm64 + run: arch -arm64 /opt/homebrew/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6);$(brew --prefix libarchive)" -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: + runs-on: [self-hosted, macOS, ARM64] + + steps: + - name: Create build directory + run: mkdir ${{runner.workspace}}/build/x86_64 + + - name: Configure + working-directory: ${{runner.workspace}}/build/x86_64 + run: arch -x86_64 /usr/local/bin/cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6);$(brew --prefix libarchive)" -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: + 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: 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 + |