From 05487020436d8bf450d92c7c979add67be1c22fb Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Mon, 19 Oct 2020 11:24:37 +0200 Subject: [PATCH] macOS CI fixes --- .travis/build-macos.sh | 4 ++-- .travis/sign-macos.sh | 9 +++++++-- src/CMakeLists.txt | 10 ---------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.travis/build-macos.sh b/.travis/build-macos.sh index 4629442b..3e861deb 100755 --- a/.travis/build-macos.sh +++ b/.travis/build-macos.sh @@ -4,6 +4,6 @@ if echo $TRAVIS_TAG | grep ^v; then BUILD_TYPE=RelWithDebInfo; else BUILD_TYPE=D mkdir build cd build -cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -make +cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. +make -j2 make test_solvespace diff --git a/.travis/sign-macos.sh b/.travis/sign-macos.sh index e5e76232..da90ec21 100755 --- a/.travis/sign-macos.sh +++ b/.travis/sign-macos.sh @@ -2,7 +2,7 @@ cd build -# app="bin/SolveSpace.app" +app="bin/SolveSpace.app" dmg="bin/SolveSpace.dmg" bundle_id="com.solvespace.solvespace" @@ -18,11 +18,16 @@ security unlock-keychain -p secret build.keychain security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PASSWORD -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple: -s -k secret build.keychain -#security set-keychain-settings -t 3600 -u build.keychain # check if all is good security find-identity -v +# sign the .app +codesign -s "${MACOS_DEVELOPER_ID}" --timestamp --options runtime -f --deep "${app}" + +# create the .dmg from the signed .app +hdiutil create -srcfolder "${app}" "${dmg}" + # sign the .dmg codesign -s "${MACOS_DEVELOPER_ID}" --timestamp --options runtime -f --deep "${dmg}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b6d9005..fd8359f6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -410,14 +410,4 @@ if(APPLE) COMMAND ${CMAKE_COMMAND} -E copy $ ${bundle_bin} COMMENT "Bundling executable solvespace-cli" VERBATIM) - - add_custom_command(OUTPUT ${EXECUTABLE_OUTPUT_PATH}/${bundle}.dmg - COMMAND ${CMAKE_COMMAND} -E remove ${EXECUTABLE_OUTPUT_PATH}/${bundle}.dmg - COMMAND hdiutil create -srcfolder ${EXECUTABLE_OUTPUT_PATH}/${bundle}.app - ${EXECUTABLE_OUTPUT_PATH}/${bundle}.dmg - DEPENDS solvespace - COMMENT "Building ${bundle}.dmg" - VERBATIM) - add_custom_target(${bundle}-dmg ALL - DEPENDS ${EXECUTABLE_OUTPUT_PATH}/${bundle}.dmg) endif()