diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index bddab5300..e0d7f33d9 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -50,6 +50,7 @@ jobs: with: configurePreset: '${{ matrix.cmake_preset }}' buildPreset: '${{ matrix.cmake_preset }}' + packagePreset: '${{ matrix.cmake_preset }}' - name: Create gnupg directory for tests run: mkdir -p ~/.gnupg && chmod go-rwx ~/.gnupg diff --git a/CMakePresets.json b/CMakePresets.json index 1c17f166e..eb4304266 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -64,5 +64,15 @@ "configuration": "Release", "targets": "install" } + ], + "packagePresets": [ + { + "name": "macOS-10", + "configurePreset": "macOS-10" + }, + { + "name": "macOS-12-m1", + "configurePreset": "macOS-12-m1" + } ] } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5235f920..c8eea6f1a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,4 +173,7 @@ qt_deploy_runtime_dependencies( VERBOSE )") install(SCRIPT ${deploy_script}) + + set(CPACK_GENERATOR "DragNDrop") + include(CPack) endif() diff --git a/utils/github/bundle-macos.sh b/utils/github/bundle-macos.sh index b1171a060..9417f21e4 100755 --- a/utils/github/bundle-macos.sh +++ b/utils/github/bundle-macos.sh @@ -2,16 +2,10 @@ # Creates macOS bundle. set -xeuo pipefail -app_bundle_path="CopyQ.app" +cpack +app_bundle_path="CopyQ.app" executable="${PWD}/${app_bundle_path}/Contents/MacOS/CopyQ" -plugins=("$app_bundle_path/Contents/PlugIns/copyq/"*.so) -qt_bin="$(brew --prefix qt@6)/bin" - -rm -r "$app_bundle_path/Contents/PlugIns/"{networkinformation,imageformats/libqpdf.dylib,platforminputcontexts} - -"$qt_bin/macdeployqt" "$app_bundle_path" -dmg -verbose=2 -always-overwrite -no-plugins \ - "${plugins[@]/#/-executable=}" ls -Rl "$app_bundle_path" @@ -49,3 +43,5 @@ otool -L "$executable" otool -L "$app_bundle_path/Contents/PlugIns/"*/*.dylib otool -L "$app_bundle_path/Contents/PlugIns/copyq/"* otool -L "$app_bundle_path/Contents/Frameworks/"Qt*.framework/Versions/*/Qt* + +mv copyq-*.dmg CopyQ.dmg