Update macOS Build Configuration for Universal Binary (Intel & ARM) (#22)

* Update build configuration for macOS

* remove -dmg  param from macos build
This commit is contained in:
Mateusz Wozniak 2025-03-12 19:13:08 +01:00 committed by GitHub
parent 82cb6f3108
commit 0ee258df2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,30 +51,54 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
version: "6.7.2"
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Create Build Environment
run: |
mkdir build
mkdir -p build/x86_64 build/arm64 build/universal
- name: Configure CMake
working-directory: ${{github.workspace}}/build
- name: Configure CMake (x86_64)
working-directory: ${{ github.workspace }}/build/x86_64
shell: bash
run: |
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 ../..
- name: Build
working-directory: ${{github.workspace}}/build
- name: Configure CMake (arm64)
working-directory: ${{ github.workspace }}/build/arm64
shell: bash
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 ../..
- name: Build (x86_64)
working-directory: ${{ github.workspace }}/build/x86_64
shell: bash
run: |
make -j4
macdeployqt NDSFactory.app
- name: Build (arm64)
working-directory: ${{ github.workspace }}/build/arm64
shell: bash
run: |
make -j4
- name: Create Universal Binary
working-directory: ${{ github.workspace }}/build
shell: bash
run: |
cp -R x86_64/NDSFactory.app universal/
lipo -create -output universal/NDSFactory.app/Contents/MacOS/NDSFactory x86_64/NDSFactory.app/Contents/MacOS/NDSFactory arm64/NDSFactory.app/Contents/MacOS/NDSFactory
- name: Deploy Qt Frameworks
working-directory: ${{ github.workspace }}/build/universal
shell: bash
run: |
macdeployqt NDSFactory.app -verbose=1
- name: Archive Artifact
working-directory: ${{github.workspace}}/build
working-directory: ${{ github.workspace }}/build/universal
shell: bash
run: |
zip -r NDSFactory-${{ github.ref_name }}-macOS.zip NDSFactory.app ../README.md ../LICENSE
@ -83,7 +107,7 @@ jobs:
uses: softprops/action-gh-release@v2.0.8
if: startsWith(github.ref, 'refs/tags/')
with:
files: "build/NDSFactory-${{ github.ref_name }}-macOS.zip"
files: "build/universal/NDSFactory-${{ github.ref_name }}-macOS.zip"
build-windows:
runs-on: windows-latest
@ -94,7 +118,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
version: "6.7.2"
- name: Install CMake
uses: lukka/get-cmake@latest