Cirrus build for Apple Silicon - maybe

cirrus_ci_apple_silicon
Joseph Donofry 2 years ago committed by Joseph Donofry
parent ccd2465066
commit 2d791f8a85
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
  1. 12
      .ci/macos/notarize.sh
  2. 23
      .cirrus.yml
  3. 47
      .gitlab-ci.yml

@ -10,10 +10,14 @@ PATH="/usr/local/opt/qt@5/bin/:${PATH}"
security unlock-keychain -p "${RUNNER_USER_PW}" login.keychain security unlock-keychain -p "${RUNNER_USER_PW}" login.keychain
if [ "${CI_PIPELINE_TRIGGERED}" ]; then
cat "${TRIGGER_PAYLOAD}"
fi
( cd build || exit ( cd build || exit
# macdeployqt does not copy symlinks over. # macdeployqt does not copy symlinks over.
# this specifically addresses icu4c issues but nothing else. # this specifically addresses icu4c issues but nothing else.
# We might not even need this any longer... # We might not even need this any longer...
# ICU_LIB="$(brew --prefix icu4c)/lib" # ICU_LIB="$(brew --prefix icu4c)/lib"
# export ICU_LIB # export ICU_LIB
# mkdir -p nheko.app/Contents/Frameworks # mkdir -p nheko.app/Contents/Frameworks
@ -72,7 +76,7 @@ while sleep 60 && date; do
#isSuccess=$(grep "success" "$NOTARIZE_STATUS_LOG") #isSuccess=$(grep "success" "$NOTARIZE_STATUS_LOG")
#isFailure=$(grep "invalid" "$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 if [ "${sub_status}" = "Accepted" ]; then
echo "Notarization done!" echo "Notarization done!"
@ -91,7 +95,7 @@ done
VERSION=${CI_COMMIT_SHORT_SHA} VERSION=${CI_COMMIT_SHORT_SHA}
if [ -n "$VERSION" ]; then if [ -n "$VERSION" ]; then
mv nheko.dmg "nheko-${VERSION}.dmg" mv nheko.dmg "nheko-${VERSION}_${PLAT}.dmg"
mkdir artifacts mkdir artifacts
cp "nheko-${VERSION}.dmg" artifacts/ cp "nheko-${VERSION}_${PLAT}.dmg" artifacts/
fi fi

@ -0,0 +1,23 @@
task:
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:13
name: Build - macOS Apple Silicon
homebrew_script:
- brew bundle --file .ci/macos/Brewfile
build_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)
binaries_artifacts:
path: build/nheko.app

@ -4,6 +4,11 @@ variables:
# prevent configure tzdata hanging apt install commands # prevent configure tzdata hanging apt install commands
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
# default to not running jobs when pipeline is triggered from a webhook.
default:
rules:
- if : '!$CI_PIPELINE_TRIGGERED'
build-clazy: build-clazy:
stage: build stage: build
image: ubuntu:22.04 image: ubuntu:22.04
@ -14,10 +19,10 @@ build-clazy:
before_script: before_script:
- apt-get update - apt-get update
- apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake liblmdb-dev libre2-dev - apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake liblmdb-dev libre2-dev
libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev
qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev
qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform
qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev
script: script:
- export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}" - export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}"
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l) - export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
@ -41,11 +46,11 @@ build-gcc11:
TRAVIS_OS_NAME: linux TRAVIS_OS_NAME: linux
before_script: before_script:
- apt-get update - apt-get update
- apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake ccache liblmdb-dev - apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake ccache liblmdb-dev
libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev
qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev
qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform
qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev
# need recommended deps for wget # need recommended deps for wget
- apt-get -y install wget - apt-get -y install wget
- /usr/sbin/update-ccache-symlinks - /usr/sbin/update-ccache-symlinks
@ -77,11 +82,11 @@ build-gcc10:
TRAVIS_OS_NAME: linux TRAVIS_OS_NAME: linux
before_script: before_script:
- apt-get update - apt-get update
- apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake ccache liblmdb-dev - apt-get -y install --no-install-suggests --no-install-recommends ca-certificates build-essential ninja-build cmake gcc make automake ccache liblmdb-dev
libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev
qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev
qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform
qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git nlohmann-json3-dev libcmark-dev asciidoc # libolm-dev
# need recommended deps for wget # need recommended deps for wget
- apt-get -y install wget - apt-get -y install wget
- /usr/sbin/update-ccache-symlinks - /usr/sbin/update-ccache-symlinks
@ -143,6 +148,8 @@ build-macos:
codesign-macos: codesign-macos:
stage: deploy stage: deploy
tags: [macos] tags: [macos]
variables:
PLAT: "intel"
before_script: before_script:
- 'brew upgrade qt@5' - 'brew upgrade qt@5'
- pip3 install dmgbuild - pip3 install dmgbuild
@ -150,15 +157,19 @@ codesign-macos:
- export PATH=/usr/local/opt/qt@5/bin/:${PATH} - export PATH=/usr/local/opt/qt@5/bin/:${PATH}
- ./.ci/macos/notarize.sh - ./.ci/macos/notarize.sh
after_script: after_script:
- ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg - ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}_${PLAT}.dmg
needs: needs:
- build-macos - job: build-macos
optional: true # optional since we want to be able to also trigger this job from cirrus ci for apple silicon builds.
rules: rules:
- if: '$CI_COMMIT_BRANCH == "master"' - if : '$CI_COMMIT_BRANCH == "master"'
- if : $CI_COMMIT_TAG - if : $CI_COMMIT_TAG
- if : $CI_PIPELINE_TRIGGERED
variables:
PLAT: "m1"
artifacts: artifacts:
paths: paths:
- artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg - artifacts/nheko-${CI_COMMIT_SHORT_SHA}_${PLAT}.dmg
- /tmp/notarize* - /tmp/notarize*
name: nheko-${CI_COMMIT_SHORT_SHA}-macos name: nheko-${CI_COMMIT_SHORT_SHA}-macos

Loading…
Cancel
Save