Skip to content

Commit

Permalink
Could we get to green macos on forked repo?
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Sep 8, 2024
1 parent 112d123 commit ab7ee04
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
- name: ⛓️ Setup SSH
uses: webfactory/[email protected]
if: ${{ github.repository_owner == 'opengisch' }}
with:
ssh-private-key: ${{ secrets.SSH_KEY_DEPLOYMENT_CERTIFICATES }}

Expand All @@ -56,6 +57,7 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: 🔏 Setup code signing
if: ${{ github.repository_owner == 'opengisch' }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
Expand Down Expand Up @@ -133,6 +135,8 @@ jobs:
ctest --output-on-failure -R smoke -C ${{ env.BUILD_TYPE }}
- name: 📦 Package
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
echo "Killing XProtect..."; sudo pkill -9 XProtect >/dev/null || true; # see https://github.com/actions/runner-images/issues/7522
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target bundle --config ${{ env.BUILD_TYPE }}
Expand Down
37 changes: 28 additions & 9 deletions platform/macos/CPackMacDeployQt.cmake.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# -appstore-compliant will strip away odbc, psql and webengine plugins
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" qfield.app -appstore-compliant -qmldir=${CMAKE_SOURCE_DIR}/src/qml -codesign=${MACOS_CODE_SIGN_IDENTITY} -sign-for-notarization=${MACOS_CODE_SIGN_IDENTITY}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin
COMMAND_ERROR_IS_FATAL ANY
)
if(NOT "$ENV{MATCH_PASSWORD}" STREQUAL ""
AND NOT "$ENV{MATCH_PASSWORD}" STREQUAL ""
AND NOT "$ENV{MATCH_PASSWORD}" STREQUAL "")
# -appstore-compliant will strip away odbc, psql and webengine plugins
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" qfield.app -appstore-compliant -qmldir=${CMAKE_SOURCE_DIR}/src/qml -codesign=${MACOS_CODE_SIGN_IDENTITY} -sign-for-notarization=${MACOS_CODE_SIGN_IDENTITY}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin
COMMAND_ERROR_IS_FATAL ANY
)

execute_process(COMMAND create-dmg --volname "QField Installer" --hide-extension qfield.app --volicon "${CMAKE_SOURCE_DIR}/platform/macos/installer.icns" --background "${CMAKE_SOURCE_DIR}/platform/macos/installer_background.png" --window-pos 200 120 --window-size 512 320 --icon-size 100 --icon "qfield.app" 130 160 --app-drop-link 400 155 --codesign "${MACOS_CODE_SIGN_IDENTITY}" ${CMAKE_BINARY_DIR}/QField-Installer.dmg ${CMAKE_BINARY_DIR}/output/bin/qfield.app
RESULT_VARIABLE CREATE_DMG_FAILURE)
execute_process(COMMAND create-dmg --volname "QField Installer" --hide-extension qfield.app --volicon "${CMAKE_SOURCE_DIR}/platform/macos/installer.icns" --background "${CMAKE_SOURCE_DIR}/platform/macos/installer_background.png" --window-pos 200 120 --window-size 512 320 --icon-size 100 --icon "qfield.app" 130 160 --app-drop-link 400 155 --codesign "${MACOS_CODE_SIGN_IDENTITY}" ${CMAKE_BINARY_DIR}/QField-Installer.dmg ${CMAKE_BINARY_DIR}/output/bin/qfield.app
RESULT_VARIABLE CREATE_DMG_FAILURE)

if(CREATE_DMG_FAILURE)
if(CREATE_DMG_FAILURE)
message(STATUS "Creating dmg failed. Retrying ...")
execute_process(COMMAND create-dmg --volname "QField Installer" --hide-extension qfield.app --volicon "${CMAKE_SOURCE_DIR}/platform/macos/installer.icns" --background "${CMAKE_SOURCE_DIR}/platform/macos/installer_background.png" --window-pos 200 120 --window-size 512 320 --icon-size 100 --icon "qfield.app" 130 160 --app-drop-link 400 155 --codesign "${MACOS_CODE_SIGN_IDENTITY}" ${CMAKE_BINARY_DIR}/QField-Installer.dmg ${CMAKE_BINARY_DIR}/output/bin/qfield.app
COMMAND_ERROR_IS_FATAL ANY)
COMMAND_ERROR_IS_FATAL ANY)
endif()
else()
# -appstore-compliant will strip away odbc, psql and webengine plugins
execute_process(COMMAND "${MACDEPLOYQT_EXECUTABLE}" qfield.app -appstore-compliant -qmldir=${CMAKE_SOURCE_DIR}/src/qml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin
COMMAND_ERROR_IS_FATAL ANY
)

execute_process(COMMAND create-dmg --volname "QField Installer" --hide-extension qfield.app --volicon "${CMAKE_SOURCE_DIR}/platform/macos/installer.icns" --background "${CMAKE_SOURCE_DIR}/platform/macos/installer_background.png" --window-pos 200 120 --window-size 512 320 --icon-size 100 --icon "qfield.app" 130 160 --app-drop-link 400 155 ${CMAKE_BINARY_DIR}/QField-Installer.dmg ${CMAKE_BINARY_DIR}/output/bin/qfield.app
RESULT_VARIABLE CREATE_DMG_FAILURE)

if(CREATE_DMG_FAILURE)
message(STATUS "Creating dmg failed. Retrying ...")
execute_process(COMMAND create-dmg --volname "QField Installer" --hide-extension qfield.app --volicon "${CMAKE_SOURCE_DIR}/platform/macos/installer.icns" --background "${CMAKE_SOURCE_DIR}/platform/macos/installer_background.png" --window-pos 200 120 --window-size 512 320 --icon-size 100 --icon "qfield.app" 130 160 --app-drop-link 400 155 ${CMAKE_BINARY_DIR}/QField-Installer.dmg ${CMAKE_BINARY_DIR}/output/bin/qfield.app
COMMAND_ERROR_IS_FATAL ANY)
endif()
endif()

0 comments on commit ab7ee04

Please sign in to comment.