ci: macOS bundle fixes

This commit is contained in:
Luke Street 2022-06-13 03:55:12 -04:00
parent 22417bcd75
commit ce14e1c2aa
4 changed files with 15 additions and 16 deletions

View File

@ -373,25 +373,27 @@ configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
# Packaging logic # Packaging logic
list(APPEND BINARY_TARGETS metaforce) list(APPEND BINARY_TARGETS metaforce)
set(DSYM_ONLY_TARGETS "") set(EXTRA_TARGETS "")
if (TARGET crashpad_handler) if (TARGET crashpad_handler)
list(APPEND BINARY_TARGETS crashpad_handler) list(APPEND EXTRA_TARGETS crashpad_handler)
endif () endif ()
set(BIN_PREFIX "${CMAKE_INSTALL_PREFIX}") set(BIN_PREFIX "${CMAKE_INSTALL_PREFIX}")
install(TARGETS ${BINARY_TARGETS} DESTINATION ${BIN_PREFIX}) install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${BIN_PREFIX})
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo) if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
foreach (target IN LISTS BINARY_TARGETS DSYM_ONLY_TARGETS) foreach (target IN LISTS BINARY_TARGETS)
if (WIN32) if (WIN32)
install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${BIN_PREFIX} OPTIONAL) install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${BIN_PREFIX} OPTIONAL)
elseif (APPLE) elseif (APPLE)
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND dsymutil ${target})") install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND rm -fr \"$<TARGET_FILE_NAME:${target}>.dSYM\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND strip -S ${target})") install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND dsymutil \"$<TARGET_FILE:${target}>\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND strip -S \"$<TARGET_FILE:${target}>\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND mv \"$<TARGET_FILE:${target}>.dSYM\" .)")
elseif (UNIX) elseif (UNIX)
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND objcopy --only-keep-debug ${target} ${target}.dbg)") install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND objcopy --only-keep-debug ${target} ${target}.dbg)")
install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND objcopy --strip-debug --add-gnu-debuglink=${target}.dbg ${target})") install(CODE "execute_process(WORKING_DIRECTORY \"${BIN_PREFIX}\" COMMAND objcopy --strip-debug --add-gnu-debuglink=${target}.dbg ${target})")
endif () endif ()
endforeach () endforeach ()
set(DEBUG_FILES_LIST ${BINARY_TARGETS} ${DSYM_ONLY_TARGETS}) set(DEBUG_FILES_LIST ${BINARY_TARGETS})
if (WIN32) if (WIN32)
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb") list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES) list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)

View File

@ -513,8 +513,7 @@ static void SetupBasics() {
} }
#if SENTRY_ENABLED #if SENTRY_ENABLED
FileStoreManager fileMgr{"sentry-native-metaforce"}; std::string cacheDir{metaforce::FileStoreManager::instance()->getStoreRoot()};
std::string cacheDir{fileMgr.getStoreRoot()};
logvisor::RegisterSentry("metaforce", METAFORCE_WC_DESCRIBE, cacheDir.c_str()); logvisor::RegisterSentry("metaforce", METAFORCE_WC_DESCRIBE, cacheDir.c_str());
#endif #endif
} }
@ -543,8 +542,8 @@ int main(int argc, char** argv) {
return 100; return 100;
} }
SetupBasics();
metaforce::FileStoreManager fileMgr{"AxioDL", "metaforce"}; metaforce::FileStoreManager fileMgr{"AxioDL", "metaforce"};
SetupBasics();
std::vector<std::string> args; std::vector<std::string> args;
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {

View File

@ -1,10 +1,8 @@
#!/bin/bash -ex #!/bin/bash -ex
cd build/install cd build/install
# remove debug files before package
rm -r Metaforce.app/Contents/MacOS/*.dSYM
for i in metaforce crashpad_handler; do for i in metaforce crashpad_handler; do
codesign --timestamp --options runtime -s "$CODESIGN_IDENT" Metaforce.app/Contents/MacOS/$i codesign --timestamp --options runtime -s "$CODESIGN_IDENT" metaforce.app/Contents/MacOS/$i
done done
create-dmg Metaforce.app --identity="$CODESIGN_IDENT" . create-dmg metaforce.app --identity="$CODESIGN_IDENT" .
xcrun altool -t osx -f *.dmg --primary-bundle-id com.axiodl.Metaforce \ xcrun altool -t osx -f *.dmg --primary-bundle-id com.axiodl.Metaforce \
--notarize-app -u "$ASC_USERNAME" -p "$ASC_PASSWORD" --team-id "$ASC_TEAM_ID" --notarize-app -u "$ASC_USERNAME" -p "$ASC_PASSWORD" --team-id "$ASC_TEAM_ID"

View File

@ -1,3 +1,3 @@
#!/bin/bash -ex #!/bin/bash -ex
cd build/install/Metaforce.app/Contents/MacOS cd build/install
sentry-cli upload-dif --org axiodl --project metaforce metaforce{,.dSYM} --include-sources sentry-cli upload-dif --org axiodl --project metaforce metaforce.app/Contents/MacOS/metaforce metaforce.dSYM --include-sources