mirror of
https://github.com/Luca1991/NDSFactory.git
synced 2025-07-08 21:20:13 +02:00
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:
parent
82cb6f3108
commit
0ee258df2d
202
.github/workflows/build.yml
vendored
202
.github/workflows/build.yml
vendored
@ -10,121 +10,145 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential libgl1-mesa-dev libglvnd-dev cmake qt6-base-dev
|
sudo apt-get install -y build-essential libgl1-mesa-dev libglvnd-dev cmake qt6-base-dev
|
||||||
mkdir build
|
mkdir build
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make -j4
|
make -j4
|
||||||
|
|
||||||
- name: Archive Artifact
|
- name: Archive Artifact
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
tar -czvf NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz NDSFactory ../README.md ../LICENSE
|
tar -czvf NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz NDSFactory ../README.md ../LICENSE
|
||||||
|
|
||||||
- name: Release on GitHub
|
- name: Release on GitHub
|
||||||
uses: softprops/action-gh-release@v2.0.8
|
uses: softprops/action-gh-release@v2.0.8
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: "build/NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz"
|
files: "build/NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz"
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4
|
uses: jurplel/install-qt-action@v4
|
||||||
with:
|
with:
|
||||||
version: '6.7.2'
|
version: "6.7.2"
|
||||||
|
|
||||||
- name: Install CMake
|
- name: Install CMake
|
||||||
uses: lukka/get-cmake@latest
|
uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir -p build/x86_64 build/arm64 build/universal
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake (x86_64)
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{ github.workspace }}/build/x86_64
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 ../..
|
||||||
|
|
||||||
- name: Build
|
- name: Configure CMake (arm64)
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{ github.workspace }}/build/arm64
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make -j4
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 ../..
|
||||||
macdeployqt NDSFactory.app
|
|
||||||
|
|
||||||
- name: Archive Artifact
|
- name: Build (x86_64)
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{ github.workspace }}/build/x86_64
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
zip -r NDSFactory-${{ github.ref_name }}-macOS.zip NDSFactory.app ../README.md ../LICENSE
|
make -j4
|
||||||
|
|
||||||
- name: Release on GitHub
|
- name: Build (arm64)
|
||||||
uses: softprops/action-gh-release@v2.0.8
|
working-directory: ${{ github.workspace }}/build/arm64
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
files: "build/NDSFactory-${{ github.ref_name }}-macOS.zip"
|
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/universal
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
zip -r NDSFactory-${{ github.ref_name }}-macOS.zip NDSFactory.app ../README.md ../LICENSE
|
||||||
|
|
||||||
|
- name: Release on GitHub
|
||||||
|
uses: softprops/action-gh-release@v2.0.8
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
files: "build/universal/NDSFactory-${{ github.ref_name }}-macOS.zip"
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4
|
uses: jurplel/install-qt-action@v4
|
||||||
with:
|
with:
|
||||||
version: '6.7.2'
|
version: "6.7.2"
|
||||||
|
|
||||||
- name: Install CMake
|
- name: Install CMake
|
||||||
uses: lukka/get-cmake@latest
|
uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
run: |
|
run: |
|
||||||
cmake ..
|
cmake ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
run: |
|
run: |
|
||||||
cmake --build . -j4 --config Release
|
cmake --build . -j4 --config Release
|
||||||
mkdir .\Release\prod
|
mkdir .\Release\prod
|
||||||
move .\Release\NDSFactory.exe .\Release\prod
|
move .\Release\NDSFactory.exe .\Release\prod
|
||||||
windeployqt .\Release\prod\NDSFactory.exe
|
windeployqt .\Release\prod\NDSFactory.exe
|
||||||
|
|
||||||
- name: Archive Artifact
|
- name: Archive Artifact
|
||||||
working-directory: ${{github.workspace}}/build/Release
|
working-directory: ${{github.workspace}}/build/Release
|
||||||
run: |
|
run: |
|
||||||
xcopy ..\..\README.md .\prod
|
xcopy ..\..\README.md .\prod
|
||||||
xcopy ..\..\LICENSE .\prod
|
xcopy ..\..\LICENSE .\prod
|
||||||
powershell "Compress-Archive -Path .\prod\* -DestinationPath .\NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
powershell "Compress-Archive -Path .\prod\* -DestinationPath .\NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||||
|
|
||||||
- name: Release on GitHub
|
- name: Release on GitHub
|
||||||
uses: softprops/action-gh-release@v2.0.8
|
uses: softprops/action-gh-release@v2.0.8
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: "build/Release/NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
files: "build/Release/NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user