ci: fix macOS codesigning (#3408)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2025-01-23 11:41:34 -05:00 committed by GitHub
parent a97a28fe4f
commit 15f66570fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View File

@ -85,6 +85,16 @@ jobs:
-DGPT4ALL_GEN_CPACK_CONFIG=ON
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target package
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake . -DGPT4ALL_GEN_CPACK_CONFIG=OFF
# The 'install' step here *should* be completely unnecessary. There is absolutely no reason we should have
# to copy all of the build artifacts to an output directory that we do not use (because we package GPT4All
# as an installer instead).
# However, because of the way signing is implemented in the cmake script, the *source* files are signed at
# install time instead of the *installed* files. This side effect is the *only* way libraries that are not
# processed by macdeployqt, such as libllmodel.so, get signed (at least, with -DBUILD_UNIVERSAL=ON).
# Also, we have to run this as a *separate* step. Telling cmake to run both targets in one command causes it
# to execute them in parallel, since it is not aware of the dependency of the package target on the install
# target.
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target install
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target package
ccache -s
mkdir upload
@ -224,6 +234,8 @@ jobs:
-DGPT4ALL_GEN_CPACK_CONFIG=ON
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target package
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake . -DGPT4ALL_GEN_CPACK_CONFIG=OFF
# See comment above related to the 'install' target.
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target install
~/Qt/Tools/CMake/CMake.app/Contents/bin/cmake --build . --target package
ccache -s
mkdir upload

View File

@ -10,6 +10,10 @@ set(APP_VERSION "${APP_VERSION_BASE}")
project(gpt4all VERSION ${APP_VERSION_BASE} LANGUAGES CXX C)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "..." FORCE)
endif()
if(APPLE)
option(BUILD_UNIVERSAL "Build a Universal binary on macOS" OFF)
if(BUILD_UNIVERSAL)
@ -126,10 +130,6 @@ message(STATUS "Qt 6 root directory: ${Qt6_ROOT_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "..." FORCE)
endif()
add_subdirectory(deps)
add_subdirectory(../gpt4all-backend llmodel)