--- name: macOS on: push: branches: [master] tags: ['v*'] pull_request: branches: [master] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: QT_VERSION: '6.11.1' KF_VERSION: '6.29' KF_PATCH: '0' KF_BRANCH: stable QCA_VERSION: '2.3.10' QTKEYCHAIN_VERSION: '0.17.0' jobs: build: permissions: contents: read outputs: version: ${{ steps.version.outputs.version }} name: ${{matrix.buildname}} runs-on: ${{matrix.os}} strategy: # Avoid canceling all jobs on transient failures. fail-fast: false matrix: include: - os: macos-15-intel buildname: macOS 13 bundle_suffix: '-macos-13' cmake_preset: macOS-13 - os: macos-14 buildname: macOS 13 M1 bundle_suffix: '-macos-13-m1' cmake_preset: macOS-13-m1 steps: - name: Checkout source code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v5 with: submodules: false # Full commit history needed for sortable version string (git describe in CMake). # Blobless filter skips file content for historical commits to speed up clone. fetch-depth: 0 filter: blob:none persist-credentials: false - name: Enable ccache uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 with: key: ${{ github.job }}-${{ matrix.os }} max-size: 1G - name: Set up ccache run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - name: Install Qt uses: jurplel/install-qt-action@a9c63c7c123f3069cff414e7e482d95dfa9d8125 # v4 with: version: ${{ env.QT_VERSION }} modules: qtimageformats qt5compat cache: true set-env: true - name: Set up dependency paths run: | DEPS_PREFIX=$GITHUB_WORKSPACE/deps/install # install-qt-action sets QT_ROOT_DIR but may not set CMAKE_PREFIX_PATH. echo "DEPS_PREFIX=$DEPS_PREFIX" >> "$GITHUB_ENV" echo "CMAKE_PREFIX_PATH=${DEPS_PREFIX};${QT_ROOT_DIR}" >> "$GITHUB_ENV" - name: Restore cached dependencies id: cache-deps uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ github.workspace }}/deps/install key: >- macos-deps-kf${{ env.KF_VERSION }}.${{ env.KF_PATCH }}-qca${{ env.QCA_VERSION }}-qtkeychain${{ env.QTKEYCHAIN_VERSION }}-${{ runner.arch }}-${{ hashFiles('utils/patches/**') }} - name: Build dependencies if: steps.cache-deps.outputs.cache-hit != 'true' run: '${{ github.workspace }}/utils/github/build-macos-deps.sh' - name: Save dependency cache if: github.event_name == 'push' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ github.workspace }}/deps/install key: >- macos-deps-kf${{ env.KF_VERSION }}.${{ env.KF_PATCH }}-qca${{ env.QCA_VERSION }}-qtkeychain${{ env.QTKEYCHAIN_VERSION }}-${{ runner.arch }}-${{ hashFiles('utils/patches/**') }} - name: Download miniaudio uses: $/.github/actions/download-miniaudio - name: Build with CMake run: | cmake --preset '${{ matrix.cmake_preset }}' cmake --build --preset '${{ matrix.cmake_preset }}' - name: Create gnupg directory for tests run: mkdir -p ~/.gnupg && chmod go-rwx ~/.gnupg - name: Get version string id: version uses: $/.github/actions/get-version with: build_dir: ${{ github.workspace }}/build/copyq/${{ matrix.cmake_preset }} - name: Create macOS bundle working-directory: '${{github.workspace}}/build/copyq/${{ matrix.cmake_preset }}' # Retry cpack due to frequent errors: "hdiutil: create failed - Resource busy" run: (cpack || cpack || cpack) && mv -v copyq-*.dmg "CopyQ-${APP_VERSION}${BUNDLE_SUFFIX}.dmg" env: APP_VERSION: ${{ steps.version.outputs.version }} BUNDLE_SUFFIX: ${{ matrix.bundle_suffix }} - name: Upload macOS bundle uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: 'CopyQ-${{ steps.version.outputs.version }}${{ matrix.bundle_suffix }}.dmg' path: '${{github.workspace}}/build/copyq/${{ matrix.cmake_preset }}/CopyQ-${{ steps.version.outputs.version }}${{ matrix.bundle_suffix }}.dmg' archive: false - name: Test working-directory: '${{github.workspace}}/build/copyq/${{ matrix.cmake_preset }}' run: '${{github.workspace}}/utils/github/test-macos.sh' - name: Upload crash reports if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: 'crash-reports${{ matrix.bundle_suffix }}' path: '~/Library/Logs/DiagnosticReports/*' if-no-files-found: ignore