name: qt-macos-arm64 on: push: branches: [ main ] tags: [ 'v*' ] pull_request: branches: [ main ] workflow_dispatch: jobs: qt-macos-arm64: runs-on: macos-arm64 defaults: run: shell: bash steps: - uses: actions/checkout@v4 - name: Prepare PATH run: | echo "/opt/homebrew/bin" >> "$GITHUB_PATH" echo "/opt/homebrew/opt/qt/bin" >> "$GITHUB_PATH" - name: Verify toolchain run: | set -euo pipefail cmake --version | head -n1 qmake --version | head -n2 which macdeployqt xcode-select -p - name: Configure + build app bundle run: | set -euo pipefail rm -rf build-out artifacts cmake -S . -B build-out -G Ninja -DCMAKE_BUILD_TYPE=Release cmake --build build-out --parallel "$(sysctl -n hw.ncpu)" - name: Deploy and sign Qt app bundle run: | set -euo pipefail app_path="$(find build-out -maxdepth 2 -type d -name 'qt_tray_demo.app' | head -n1 || true)" [ -n "$app_path" ] || { echo 'No Qt .app bundle produced'; exit 1; } macdeployqt "$app_path" || true codesign --force --deep --sign - "$app_path" codesign --verify --deep --strict --verbose=2 "$app_path" spctl -a -vv "$app_path" || true - name: Pack artifact and copy to Desktop run: | set -euo pipefail mkdir -p artifacts "$HOME/Desktop" app_path="$(find build-out -maxdepth 2 -type d -name 'qt_tray_demo.app' | head -n1 || true)" [ -n "$app_path" ] || { echo 'No deployed Qt .app bundle found'; exit 1; } out="qt_tray_demo-macos-arm64-run${{ github.run_number }}.zip" ditto -c -k --sequesterRsrc --keepParent "$app_path" "artifacts/$out" cp "artifacts/$out" "$HOME/Desktop/$out" - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: qt_tray_demo-macos-arm64-run${{ github.run_number }} path: artifacts/ retention-days: 14