diff options
author | Joe Donofry <rubberduckie3554@gmail.com> | 2022-10-27 22:21:59 +0000 |
---|---|---|
committer | Joe Donofry <rubberduckie3554@gmail.com> | 2022-10-27 22:21:59 +0000 |
commit | 1d477dfc65c79511e012daf74cf02aac41b9c2ea (patch) | |
tree | 1600912418502998c2b176337cfbcec368e6454b /.ci | |
parent | fix blurry thumbnails (diff) | |
parent | Add support for Apple Silicon builds via Cirrus CI (diff) | |
download | nheko-1d477dfc65c79511e012daf74cf02aac41b9c2ea.tar.xz |
Merge branch 'cirrus_ci_apple_silicon' into 'master'
See merge request nheko-reborn/nheko!22
Diffstat (limited to '.ci')
-rwxr-xr-x | .ci/macos/build.sh | 32 | ||||
-rwxr-xr-x | .ci/macos/deploy.sh | 34 | ||||
-rwxr-xr-x | .ci/macos/notarize.sh | 40 |
3 files changed, 55 insertions, 51 deletions
diff --git a/.ci/macos/build.sh b/.ci/macos/build.sh new file mode 100755 index 00000000..ef95181c --- /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 \ + -DCI_BUILD=ON +cmake --build build +( cd build || exit + git clone https://github.com/Nheko-Reborn/qt-jdenticon.git + ( cd qt-jdenticon || exit + qmake + make -j 4 + cp libqtjdenticon.dylib ../nheko.app/Contents/MacOS + ) + macdeployqt nheko.app -always-overwrite -qmldir=../resources/qml/ +) 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 af62a6d2..7a67306d 100755 --- a/.ci/macos/notarize.sh +++ b/.ci/macos/notarize.sh @@ -7,24 +7,28 @@ 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 -( 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/ +if [ "${CI_PIPELINE_TRIGGERED}" ] && [ "${TRIGGERED_BY}" = "cirrus" ]; then + echo "cirrus build id: ${TRIGGER_BUILD_ID}" + cat "${TRIGGER_PAYLOAD}" + # download the build artifacts from cirrus api + curl "https://api.cirrus-ci.com/v1/artifact/build/${TRIGGER_BUILD_ID}/binaries.zip" -o binaries.zip + # cirrus ci artifacts task name is 'binaries' so that's the zip name. + unzip binaries.zip + # we zip 'build/nheko.app' in cirrus ci, cirrus itself puts it in a 'build' directory + # so move it to the right place for the rest of the process. + ( cd build || exit + unzip nheko.zip + ) +fi - # user=$(id -nu) - # chown "${user}" nheko.dmg -) +if [ ! -d "build/nheko.app" ]; then + echo "nheko.app is missing, you did something wrong!" + exit 1 +fi echo "[INFO] Signing app contents" find "build/nheko.app/Contents"|while read -r fname; do @@ -46,6 +50,7 @@ trap finish EXIT dmgbuild -s .ci/macos/settings.json "Nheko" nheko.dmg codesign -s "${APPLE_DEV_IDENTITY}" nheko.dmg + user=$(id -nu) chown "${user}" nheko.dmg @@ -72,7 +77,7 @@ while sleep 60 && date; do #isSuccess=$(grep "success" "$NOTARIZE_STATUS_LOG") #isFailure=$(grep "invalid" "$NOTARIZE_STATUS_LOG") - echo "Status for submission \"${requestUUID}\": \"${sub_status}\"" + echo "Status for submission \"${requestUUID}\": \"${sub_status}\"" if [ "${sub_status}" = "Accepted" ]; then echo "Notarization done!" @@ -82,6 +87,7 @@ while sleep 60 && date; do fi if [ "${sub_status}" = "Invalid" ] || [ "${sub_status}" = "Rejected" ]; then echo "Notarization failed" + xcrun notarytool log "${requestUUID}" --apple-id "${APPLE_DEV_USER}" --password "${APPLE_DEV_PASS}" --team-id "${APPLE_TEAM_ID}" > "$NOTARIZE_STATUS_LOG" 2>&1 cat "$NOTARIZE_STATUS_LOG" 1>&2 exit 1 fi @@ -91,7 +97,7 @@ done VERSION=${CI_COMMIT_SHORT_SHA} if [ -n "$VERSION" ]; then - mv nheko.dmg "nheko-${VERSION}.dmg" + mv nheko.dmg "nheko-${VERSION}_${PLAT}.dmg" mkdir artifacts - cp "nheko-${VERSION}.dmg" artifacts/ + cp "nheko-${VERSION}_${PLAT}.dmg" artifacts/ fi \ No newline at end of file |