Update to QT6 #217
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build MacOS | |
| on: | |
| push: | |
| branches: | |
| - "2.5-evo" | |
| - "dev-release" | |
| - "release" | |
| - "debug_older2" | |
| - "fix_workflows" | |
| - "new_qt" | |
| - "master" | |
| paths: | |
| - 'src/**' | |
| - '.github/workflows/macOS.yml' | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: macos-14 # Use Apple Silicon runner for better performance | |
| defaults: | |
| run: | |
| working-directory: src | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.5.0' | |
| host: 'mac' | |
| target: 'desktop' | |
| arch: 'clang_64' | |
| archives: 'qtbase qtdeclarative qtsvg qttools' | |
| cache: true | |
| install-deps: true | |
| - name: Install create-dmg | |
| run: brew install create-dmg | |
| - name: Set Architecture Environment | |
| run: | | |
| echo "Building for Apple Silicon (arm64) to match runner and dependencies" | |
| echo "ARCHFLAGS=-arch arm64" >> $GITHUB_ENV | |
| - name: Cache FetchContent dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src/build/_deps | |
| ~/.cache/cmake | |
| key: ${{ runner.os }}-cmake-deps-${{ hashFiles('src/CMakeLists.txt', 'src/dependencies/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cmake-deps- | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| # Configure for Apple Silicon (arm64) architecture to match the runner and Homebrew libraries | |
| cmake .. \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=/usr \ | |
| -DCMAKE_OSX_ARCHITECTURES=arm64 \ | |
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | |
| - name: Build | |
| run: | | |
| cd build | |
| make -j$(sysctl -n hw.logicalcpu) | |
| - name: Create DMG | |
| run: | | |
| cd build | |
| echo "=== macOS Build Contents ===" | |
| ls -la | |
| echo "=== App Bundle Contents ===" | |
| ls -la OpenHDImageWriter.app | |
| echo "=== Creating DMG ===" | |
| create-dmg \ | |
| --volname "OpenHD ImageWriter" \ | |
| --volicon "../icons/openhdimagewriter.icns" \ | |
| --window-pos 200 120 \ | |
| --window-size 600 300 \ | |
| --icon-size 100 \ | |
| --icon "OpenHDImageWriter.app" 175 120 \ | |
| --hide-extension "OpenHDImageWriter.app" \ | |
| --app-drop-link 425 120 \ | |
| "OpenHDImageWriter-macOS.dmg" \ | |
| "OpenHDImageWriter.app" | |
| - name: Upload DMG | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "OpenHD Image Writer macOS" | |
| path: | | |
| src/build/OpenHDImageWriter-macOS.dmg | |
| if-no-files-found: error | |