From 9ed87ef3f41b4ad5cb4b1a5d6005b56748dc1b14 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 24 Oct 2022 19:28:52 -0400 Subject: [PATCH] Run macdeployqt on the correct platform for each build --- .ci/macos/build.sh | 32 ++++++++++++++++++++++++++++++++ .ci/macos/deploy.sh | 34 ---------------------------------- .ci/macos/notarize.sh | 17 +---------------- .cirrus.yml | 19 +------------------ .gitlab-ci.yml | 16 +--------------- 5 files changed, 35 insertions(+), 83 deletions(-) create mode 100755 .ci/macos/build.sh delete mode 100755 .ci/macos/deploy.sh diff --git a/.ci/macos/build.sh b/.ci/macos/build.sh new file mode 100755 index 00000000..6a883678 --- /dev/null +++ b/.ci/macos/build.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +set -u + +# unused +#TAG=$(git tag -l --points-at HEAD) + +# Add Qt binaries to path +PATH="$(brew --prefix qt5):${PATH}" +export PATH + +CMAKE_PREFIX_PATH="$(brew --prefix qt5)" +export CMAKE_PREFIX_PATH + +cmake -GNinja -S. -Bbuild \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=.deps/usr \ + -DHUNTER_ROOT="../.hunter" \ + -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo \ + -DUSE_BUNDLED_OPENSSL=ON \ + -DUSE_BUNDLED_BOOST=ON \ + -DCI_BUILD=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 +cmake --build build +( cd build || exit + git clone https://github.com/Nheko-Reborn/qt-jdenticon.git + cd qt-jdenticon && qmake && make -j 4 + cp libqtjdenticon.dylib ../nheko.app/Contents/MacOS +) + +macdeployqt nheko.app -always-overwrite -qmldir=../resources/qml/ \ No newline at end of file diff --git a/.ci/macos/deploy.sh b/.ci/macos/deploy.sh deleted file mode 100755 index 56a1f23a..00000000 --- a/.ci/macos/deploy.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env sh - -set -eux - -# unused -#TAG=$(git tag -l --points-at HEAD) - -# Add Qt binaries to path -PATH=/usr/local/opt/qt@5/bin/:${PATH} - -( cd build - # macdeployqt does not copy symlinks over. - # this specifically addresses icu4c issues but nothing else. - ICU_LIB="$(brew --prefix icu4c)/lib" - export ICU_LIB - mkdir -p nheko.app/Contents/Frameworks - find "${ICU_LIB}" -type l -name "*.dylib" -exec cp -a -n {} nheko.app/Contents/Frameworks/ \; || true - - macdeployqt nheko.app -dmg -always-overwrite -qmldir=../resources/qml/ - - user=$(id -nu) - chown "${user}" nheko.dmg - mv nheko.dmg .. -) - -dmgbuild -s ./.ci/macos/settings.json "Nheko" nheko.dmg - -VERSION=${CI_COMMIT_SHORT_SHA} - -if [ -n "$VERSION" ]; then - mv nheko.dmg "nheko-${VERSION}.dmg" - mkdir artifacts - cp "nheko-${VERSION}.dmg" artifacts/ -fi diff --git a/.ci/macos/notarize.sh b/.ci/macos/notarize.sh index 81158ed2..a66777b8 100755 --- a/.ci/macos/notarize.sh +++ b/.ci/macos/notarize.sh @@ -7,6 +7,7 @@ set -u # Add Qt binaries to path PATH="/usr/local/opt/qt@5/bin/:${PATH}" +export PATH security unlock-keychain -p "${RUNNER_USER_PW}" login.keychain @@ -31,22 +32,6 @@ if [ ! -d "build/nheko.app" ]; then exit 1 fi -( cd build || exit - # macdeployqt does not copy symlinks over. - # this specifically addresses icu4c issues but nothing else. - # We might not even need this any longer... - # ICU_LIB="$(brew --prefix icu4c)/lib" - # export ICU_LIB - # mkdir -p nheko.app/Contents/Frameworks - # find "${ICU_LIB}" -type l -name "*.dylib" -exec cp -a -n {} nheko.app/Contents/Frameworks/ \; || true - - #macdeployqt nheko.app -dmg -always-overwrite -qmldir=../resources/qml/ -sign-for-notarization="${APPLE_DEV_IDENTITY}" - macdeployqt nheko.app -always-overwrite -qmldir=../resources/qml/ - - # user=$(id -nu) - # chown "${user}" nheko.dmg -) - echo "[INFO] Signing app contents" find "build/nheko.app/Contents"|while read -r fname; do if [ -f "$fname" ]; then diff --git a/.cirrus.yml b/.cirrus.yml index b92fc36e..03f7b1a6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,24 +9,7 @@ task: - brew bundle --file .ci/macos/Brewfile build_script: - export PATH="$(brew --prefix qt5)/bin/:${PATH}" - - export CMAKE_PREFIX_PATH="$(brew --prefix qt5)" - - echo "$(brew --prefix qt5)" - - cmake -GNinja -S. -Bbuild - -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DCMAKE_INSTALL_PREFIX=.deps/usr - -DHUNTER_ROOT="../.hunter" - -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF - -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo - -DUSE_BUNDLED_OPENSSL=ON - -DQT_PATH="$(brew --prefix qt5)", - -DQt5_DIR:PATH="$(brew --prefix qt5)/lib/cmake/Qt5", - -DQt5MacExtras_DIR:PATH="$(brew --prefix qt5)/lib/cmake/Qt5MacExtras", - -DQt5DBus_DIR:PATH="$(brew --prefix qt5)/lib/cmake/Qt5DBus", - -DQt5QuickCompiler_DIR:PATH="$(brew --prefix qt5)/lib/cmake/Qt5QuickCompiler", - -DCI_BUILD=ON - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 - - cmake --build build - - (cd build && git clone https://github.com/Nheko-Reborn/qt-jdenticon.git && cd qt-jdenticon && qmake && make -j 4 && cp libqtjdenticon.dylib ../nheko.app/Contents/MacOS) + - ./.ci/macos/build.sh zip_script: - zip -r build/nheko.zip build/nheko.app gitlab_script: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6705d03d..732e7cac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -118,20 +118,7 @@ build-macos: before_script: - rm -rf ../.hunter && mv .hunter ../.hunter || true script: - - export PATH=/usr/local/opt/qt@5/bin/:${PATH} - - export CMAKE_PREFIX_PATH=/usr/local/opt/qt@5 - - cmake -GNinja -H. -Bbuild - -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DCMAKE_INSTALL_PREFIX=.deps/usr - -DHUNTER_ROOT="../.hunter" - -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF - -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo - -DUSE_BUNDLED_OPENSSL=ON - -DUSE_BUNDLED_BOOST=ON - -DCI_BUILD=ON - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 - - cmake --build build - - (cd build && git clone https://github.com/Nheko-Reborn/qt-jdenticon.git && cd qt-jdenticon && qmake && make -j 4 && cp libqtjdenticon.dylib ../nheko.app/Contents/MacOS) + - ./.ci/macos/build.sh after_script: - mv ../.hunter .hunter rules: @@ -154,7 +141,6 @@ codesign-macos: variables: PLAT: "intel" before_script: - - 'brew upgrade qt@5' - pip3 install dmgbuild script: - export PATH=/usr/local/opt/qt@5/bin/:${PATH}