From 80affdba858eb19221c4a56f036ec60446eca44f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 17 Feb 2023 14:49:53 +0200 Subject: [PATCH] Testing macos build. --- .cirrus.yml | 121 ++++++++++++++++++++------------------- scripts/cirrus-deploy.sh | 30 +++++++--- 2 files changed, 86 insertions(+), 65 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7442ef76d..30a28a87b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -86,64 +86,7 @@ linux_qt5_qbs_task_template: &LINUX_QT5_QBS_TASK_TEMPLATE - qbs -p autotest-runner -d build profile:qt5 config:release - ccache -s -#macos_task_template: &MACOS_TASK_TEMPLATE -# << : *REGULER_TASK_TEMPLATE -# timeout_in: 120m -# env: -# ACCESS_TOKEN: ENCRYPTED[81e0b2381ffb628b73f5c94f834010e6631191e0ad03cdd0850d440fb2737a74b68131d842030f010c1bf73ab4cdc1ae] -# QTDIR: "/usr/local/opt/qt5" -# PATH: ${HOME}/.local/bin:$QTDIR/bin:${PATH} -# # ^ add user paths -# PIP_CACHE_DIR: ${HOME}/.cache/pip -# DEPLOY: "true" -# LDFLAGS: "-L$QTDIR/lib" -# CPPFLAGS: "-I$QTDIR/include" -# PKG_CONFIG_PATH: "/usr/local/opt/qt5/lib/pkgconfig" -# global_homebrew_cache: -# folder: "/usr/local/Homebrew" -# local_homebrew_cache: -# folder: "$HOME/Library/Caches/Homebrew" -# pip_cache: -# folder: ${PIP_CACHE_DIR} -# install_script: -# - brew update > /dev/null -# - brew install qt5 coreutils ccache -# - chmod -R 755 /usr/local/opt/qt5/* -# - python3 --version -# - pip3 install --user --upgrade pip dropbox -# build_script: -# - mkdir build -# - cd build -# - pwd -# - qmake --version -# - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=checkWarnings CONFIG+=noTests -# - ${COMPILER} --version -# - make -j$(nproc) -# deploy_script: -# - pwd -# - $CIRRUS_WORKING_DIR/scripts/cirrus-deploy.sh -# before_cache_script: -# - brew cleanup -# env: -# COMPILER: clang - -#task: -# name: 'macOS Catalina 10.15 [no tests]' -# macos_instance: -# image: catalina-xcode-11.3.1 -# << : *MACOS_TASK_TEMPLATE -# env: -# PLATFORM: "macOS_10.14+" - -#task: -# name: 'macOS Big Sur 11 [no tests]' -# macos_instance: -# image: big-sur-xcode-12.4 -# << : *MACOS_TASK_TEMPLATE -# env: -# PLATFORM: "macOS_10.15+" - -task: +linux_task: << : *REGULER_TASK_TEMPLATE env: DEBIAN_FRONTEND: "noninteractive" @@ -194,3 +137,65 @@ task: << : *LINUX_QT6_TASK_TEMPLATE env: QT_SELECT: "qt6" + +macos_task_template: &MACOS_TASK_TEMPLATE + << : *REGULER_TASK_TEMPLATE + timeout_in: 120m + env: + ACCESS_TOKEN: ENCRYPTED[81e0b2381ffb628b73f5c94f834010e6631191e0ad03cdd0850d440fb2737a74b68131d842030f010c1bf73ab4cdc1ae] + QTDIR: "/usr/local/opt/qt6" + PATH: ${HOME}/.local/bin:$QTDIR/bin:${PATH} + # ^ add user paths + PIP_CACHE_DIR: ${HOME}/.cache/pip + LDFLAGS: "-L$QTDIR/lib" + CPPFLAGS: "-I$QTDIR/include" + PKG_CONFIG_PATH: "/usr/local/opt/qt6/lib/pkgconfig" + global_homebrew_cache: + folder: "/usr/local/Homebrew" + local_homebrew_cache: + folder: "$HOME/Library/Caches/Homebrew" + pip_cache: + folder: ${PIP_CACHE_DIR} + install_script: + - brew update > /dev/null + - brew install qt6@${QT_VERSION} coreutils ccache conan qbs + - chmod -R 755 /usr/local/opt/qt6/* + - python3 --version + - pip3 install --user --upgrade pip dropbox + - ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime + - clang --version + - qmake --version + - qbs --version + build_script: + - pwd + - qbs setup-toolchains --detect + - qbs config --list profiles + - qbs setup-toolchains /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang clang + - qbs setup-qt /usr/local/opt/qt6/qmake qt6 + - qbs-config defaultProfile qt6 + - qbs config profiles.qt6.baseProfile clang + - qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build --command-echo-mode command-line config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 + - ccache -s + deploy_script: + - pwd + - $CIRRUS_WORKING_DIR/scripts/cirrus-deploy.sh + before_cache_script: + - brew cleanup + +macos_task: + macos_instance: + image: ghcr.io/cirruslabs/macos-monterey-xcode:13.4.1 + << : *MACOS_TASK_TEMPLATE + env: + DEPLOY: "true" + QT_VERSION: 6.4.2 + QT_BRANCH: Qt6 + ARCHITECTURE: arm64 + PLATFORM: "macOS_11+" + matrix: + - name: 'macOS Monterey 12 [signle bundle, no tests]' + env: + MULTI_BUNDLE: true + - name: 'macOS Monterey 12 [multi bundle, no tests]' + env: + MULTI_BUNDLE: false diff --git a/scripts/cirrus-deploy.sh b/scripts/cirrus-deploy.sh index 73c48daad..5bfc1bd75 100755 --- a/scripts/cirrus-deploy.sh +++ b/scripts/cirrus-deploy.sh @@ -20,16 +20,32 @@ check_failure() { } if [[ "$DEPLOY" == "true" ]]; then - $CIRRUS_WORKING_DIR/scripts/macfixqtdylibrpath.py $CIRRUS_WORKING_DIR/build/src/app/valentina/bin/Valentina.app; - check_failure "Unable to patch the app bundle."; - print_info "Start compressing."; - tar -C $CIRRUS_WORKING_DIR/build/src/app/valentina/bin --exclude "*.DS_Store" -cvJf valentina-${PLATFORM}-${CIRRUS_CHANGE_IN_REPO}.tar.xz Valentina.app/; - check_failure "Unable to create an archive."; + tar -C $CIRRUS_WORKING_DIR/build/install-root/usr/local/Applications --exclude "*.DS_Store" -cvJf valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz Valentina.app/; + check_failure "Unable to create an archive for Valentina bundle."; + + if [[ "$MULTI_BUNDLE" == "true" ]]; then + tar -C $CIRRUS_WORKING_DIR/build/install-root/usr/local/Applications --exclude "*.DS_Store" -cvJf tape-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz Tape.app/; + check_failure "Unable to create an archive for Tape bundle."; + + tar -C $CIRRUS_WORKING_DIR/build/install-root/usr/local/Applications --exclude "*.DS_Store" -cvJf puzzle-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz Puzzle.app/; + check_failure "Unable to create an archive for Puzzle bundle."; + fi print_info "Start uploading."; - python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/valentina-${PLATFORM}-${CIRRUS_CHANGE_IN_REPO}.tar.xz "/0.7.x/Mac OS X/valentina-${PLATFORM}-${CIRRUS_CHANGE_IN_REPO}.tar.xz"; - check_failure "Unable to upload."; + if [[ "$MULTI_BUNDLE" == "false" ]]; then + python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz "/0.7.x/Mac OS X/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz"; + check_failure "Unable to upload Valentina bundle."; + else + python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz "/0.7.x/Mac OS X/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-multibundle-${CIRRUS_CHANGE_IN_REPO}/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz"; + check_failure "Unable to upload Valentina bundle."; + + python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/tape-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz "/0.7.x/Mac OS X/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-multibundle-${CIRRUS_CHANGE_IN_REPO}/tape-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz"; + check_failure "Unable to upload Tape bundle."; + + python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/puzzle-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz "/0.7.x/Mac OS X/valentina-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-multibundle-${CIRRUS_CHANGE_IN_REPO}/puzzle-${PLATFORM}-${QT_BRANCH}-${ARCHITECTURE}-${CIRRUS_CHANGE_IN_REPO}.tar.xz"; + check_failure "Unable to upload Tape bundle."; + fi print_info "Successfully uploaded."; else