From f1abc5d7cb6e2100e5d7fc4863c8a999fd861f78 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 4 Mar 2017 18:30:31 +0100 Subject: [PATCH 1/4] [macOS, CI] Use Release configuration --- CI/before_script.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index f3d0f716b1..bec26caf13 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -13,7 +13,7 @@ cmake \ -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \ -D CMAKE_OSX_DEPLOYMENT_TARGET="10.8" \ -D CMAKE_OSX_SYSROOT="macosx10.12" \ --D CMAKE_BUILD_TYPE=Debug \ +-D CMAKE_BUILD_TYPE=Release \ -D OPENMW_OSX_DEPLOYMENT=TRUE \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ From 57c5ecfba835d1470a7475874a21eedb01f14417 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 5 Mar 2017 18:03:58 +0100 Subject: [PATCH 2/4] [macOS, CI] Use most recent prebuilt dependencies --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 49af86a3e2..2d20eb9a0f 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -7,5 +7,5 @@ brew rm pkgconfig || true brew rm qt5 || true brew install cmake pkgconfig $macos_qt_formula -curl https://downloads.openmw.org/osx/dependencies/openmw-deps-0ecece4.zip -o ~/openmw-deps.zip +curl https://downloads.openmw.org/osx/dependencies/openmw-deps-c79172d.zip -o ~/openmw-deps.zip unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null From e24cb0fe5dc29c50a29c84c2dad4913868dc9db1 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 4 Mar 2017 21:29:02 +0100 Subject: [PATCH 3/4] [macOS, CI] Configure deployment of nightly builds to FTP --- .travis.yml | 13 +++++++++++++ CI/deploy.osx.sh | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100755 CI/deploy.osx.sh diff --git a/.travis.yml b/.travis.yml index a669700c01..c3f1cdfb69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,10 @@ env: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "jybGzAdUbqt9vWR/GEnRd96BgAi/7Zd1+2HK68j/i/8+/1YH2XxLOy4Jv/DUBhBlJIkxs/Xv8dRcUlFOclZDHX1d/9Qnsqd3oUVkD7k1y7cTOWy9TBQaE/v/kZo3LpzA3xPwwthrb0BvqIbOfIELi5fS5s8ba85WFRg3AX70wWE=" + # macOS builds FTP upload login + - secure: "MegynKyJpyL7XDwdWVEbypQh7CLjqOqOi9lGF97G7Fq0HosVZTmnwjHhmIPZspTP7ES4UbxM3rs/f3ce7sp9JN2ShRJpduD6UEFc8egQXBte9J3obUBIdUxPTRdhnht7VJ+u+pksK1S/Bm1Cs6l0eEluP3vmcaXWMykVQcZsPhY=" + # macOS builds FTP upload password + - secure: "jQcAaWAdDy0+vlNu4POMX8322HanCOQEUTdpviWTAUjWQTjMa0UTM4+zVVgrtEaHMpBaVYYbTT3Rg5BQ9oG+2SiVLJBQQ2XoMcos/YrjPVT6inB02Gs0vFjP29LdPAQVrB8CkAcfQr6u+Z2C+RqAtwhE09LsBUMXjRDzPAtr1CM=" - macos_qt_formula=qt@5.5 addons: apt: @@ -62,6 +66,15 @@ script: - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi + - cd "${TRAVIS_BUILD_DIR}" +deploy: + provider: script + script: ./CI/deploy.osx.sh + skip_cleanup: true + on: + branch: master + condition: "$TRAVIS_EVENT_TYPE = cron && $TRAVIS_OS_NAME = osx" + repo: OpenMW/openmw notifications: email: recipients: diff --git a/CI/deploy.osx.sh b/CI/deploy.osx.sh new file mode 100755 index 0000000000..1ff6f89c3b --- /dev/null +++ b/CI/deploy.osx.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +cd build + +DATE=`date +'%d%m%Y'` +SHORT_COMMIT=`git rev-parse --short ${TRAVIS_COMMIT}` +TARGET_FILENAME="OpenMW-${DATE}-${SHORT_COMMIT}.dmg" + +curl --ssl --ftp-create-dirs -T *.dmg -u $OSX_FTP_USER:$OSX_FTP_PASSWORD "ftp://s3.mydevil.net:21/nightly/${TARGET_FILENAME}" From 7f429f26e17c37882d3705be8d5ed819a66a139f Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 5 Mar 2017 19:28:29 +0100 Subject: [PATCH 4/4] Allow getting available version information even when clone is shallow --- CMakeLists.txt | 18 +++++++----------- cmake/GitVersion.cmake | 15 ++++++++++----- components/version/version.cpp | 3 +-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be734a8caa..8b4e9ad4b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,18 +35,14 @@ set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VER set(GIT_CHECKOUT FALSE) if(EXISTS ${PROJECT_SOURCE_DIR}/.git) - if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) - find_package(Git) + find_package(Git) - if(GIT_FOUND) - set(GIT_CHECKOUT TRUE) - else(GIT_FOUND) - message(WARNING "Git executable not found") - endif(GIT_FOUND) - else(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) - message(STATUS "Shallow Git clone detected, not attempting to retrieve version info") - endif(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) -endif(EXISTS ${PROJECT_SOURCE_DIR}/.git) + if(GIT_FOUND) + set(GIT_CHECKOUT TRUE) + else(GIT_FOUND) + message(WARNING "Git executable not found") + endif(GIT_FOUND) +endif(EXISTS ${PROJECT_SOURCE_DIR}/.git) # Macros include(OpenMWMacros) diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake index 0679e406c2..32abbbfbf8 100644 --- a/cmake/GitVersion.cmake +++ b/cmake/GitVersion.cmake @@ -3,7 +3,8 @@ execute_process ( WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE EXITCODE1 OUTPUT_VARIABLE TAGHASH - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) execute_process ( COMMAND ${GIT_EXECUTABLE} rev-parse HEAD @@ -12,13 +13,17 @@ execute_process ( OUTPUT_VARIABLE COMMITHASH OUTPUT_STRIP_TRAILING_WHITESPACE) -string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" SUCCESS) -if (SUCCESS) +string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" FULL_SUCCESS) +string (COMPARE EQUAL "${EXITCODE2}" "0" COMMIT_SUCCESS) +if (FULL_SUCCESS) set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}") set(OPENMW_VERSION_TAGHASH "${TAGHASH}") message(STATUS "OpenMW version ${OPENMW_VERSION}") -else (SUCCESS) +elseif (COMMIT_SUCCESS) + set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}") + message(STATUS "OpenMW version ${OPENMW_VERSION}") +else () message(WARNING "Failed to get valid version information from Git") -endif (SUCCESS) +endif () configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) diff --git a/components/version/version.cpp b/components/version/version.cpp index c87943f9e2..fecbdcb3f9 100644 --- a/components/version/version.cpp +++ b/components/version/version.cpp @@ -23,8 +23,7 @@ std::string Version::describe() { std::string str = "OpenMW version " + mVersion; std::string rev = mCommitHash; - std::string tag = mTagHash; - if (!rev.empty() && !tag.empty()) + if (!rev.empty()) { rev = rev.substr(0, 10); str += "\nRevision: " + rev;