From dda7180847f2c952899dd82cb8f49a602e6397c7 Mon Sep 17 00:00:00 2001 From: Volker Enderlein Date: Mon, 25 Dec 2023 17:15:37 +0100 Subject: [PATCH] Add AppVeyor CI script --- appveyor.yml | 294 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..2326506 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,294 @@ +version: 1.0.1-{branch}-ci-{build} + +branches: + only: + - main + - /v\d*\.\d*\.\d*/ + +# do not build feature branches with open pull requests +skip_branch_with_pr: true + +#shallow clone does not work when submodules are involved! +#shallow_clone: true + +matrix: + fast_finish: true # set this flag to immediately finish build once one of the jobs fails. + +environment: + COIN_VERSION: 4.0.2 + SUPERGLU_VERSION: 1.3.1 + WXWIDGETS_SHORT_VERSION: 3.2 + WXWIDGETS_VERSION: 3.2.4 + GH_AUTH_TOKEN: + secure: 850frgRGZcc4Cljd2P7Ej68no4/kkl4EMB+DjnX725wcKBRJuFk/kGRdJGyKXd2u + matrix: +# - APPVEYOR_BUILD_WORKER_IMAGE: macos-catalina +# CMAKE_GENERATOR: 'Unix Makefiles' +# CMAKE_PLATFORM: x64 +# COMPILER_ID: clang + + - APPVEYOR_BUILD_WORKER_IMAGE: macos-bigsur + CMAKE_GENERATOR: 'Unix Makefiles' + CMAKE_PLATFORM: x64 + COMPILER_ID: clang + + - APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey + CMAKE_GENERATOR: 'Unix Makefiles' + CMAKE_PLATFORM: x64 + COMPILER_ID: clang +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804 +# CMAKE_GENERATOR: 'Unix Makefiles' +# CMAKE_PLATFORM: x86 +# CMAKE_ARCH_FLAGS: -m32 +# COMPILER_ID: gcc + + - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804 + CMAKE_GENERATOR: 'Unix Makefiles' + CMAKE_PLATFORM: x64 + CMAKE_ARCH_FLAGS: -m64 + COMPILER_ID: gcc + + - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 + CMAKE_GENERATOR: 'Unix Makefiles' + CMAKE_PLATFORM: x64 + CMAKE_ARCH_FLAGS: -m64 + COMPILER_ID: gcc + + - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204 + CMAKE_GENERATOR: 'Unix Makefiles' + CMAKE_PLATFORM: x64 + CMAKE_ARCH_FLAGS: -m64 + COMPILER_ID: gcc + +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 +# CMAKE_GENERATOR: 'Visual Studio 10 2010' +# CMAKE_ARCHITECTURE: Win32 +# CMAKE_PLATFORM: x86 +# COMPILER_ID: msvc10 +## +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 +# CMAKE_GENERATOR: 'Visual Studio 10 2010' +# CMAKE_ARCHITECTURE: x64 +# CMAKE_PLATFORM: x64 +# COMPILER_ID: msvc10 + +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# CMAKE_GENERATOR: 'Visual Studio 14 2015' +# CMAKE_ARCHITECTURE: Win32 +# CMAKE_PLATFORM: x86 +# COMPILER_ID: msvc14 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# CMAKE_GENERATOR: 'Visual Studio 14 2015' +# CMAKE_ARCHITECTURE: x64 +# CMAKE_PLATFORM: x64 +# COMPILER_ID: msvc14 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 +# CMAKE_GENERATOR: 'Visual Studio 15 2017' +# CMAKE_ARCHITECTURE: Win32 +# CMAKE_PLATFORM: x86 +# COMPILER_ID: msvc15 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 +# CMAKE_GENERATOR: 'Visual Studio 15 2017' +# CMAKE_ARCHITECTURE: x64 +# CMAKE_PLATFORM: x64 +# COMPILER_ID: msvc15 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 +# CMAKE_GENERATOR: 'Visual Studio 16 2019' +# CMAKE_ARCHITECTURE: Win32 +# CMAKE_PLATFORM: x86 +# COMPILER_ID: msvc16 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 +# CMAKE_GENERATOR: 'Visual Studio 16 2019' +# CMAKE_ARCHITECTURE: x64 +# CMAKE_PLATFORM: x64 +# COMPILER_ID: msvc16 +# +# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 +# CMAKE_GENERATOR: 'Visual Studio 17 2022' +# CMAKE_ARCHITECTURE: x64 +# CMAKE_PLATFORM: x64 +# COMPILER_ID: msvc17 + +install: + - sh: | + if [ "$COMPILER_ID" = "clang" ] + then + brew install jq gtk+ gtkglext + #brew install doxygen + else + sudo apt-get -y update + sudo apt-get -y install freeglut3-dev libgtk2.0-dev libgtkgl2.0-dev libboost-dev doxygen jq + fi + cd $APPVEYOR_BUILD_FOLDER + - cmd: | + choco install jq + rem Work around for outdated curl version giving problems with GitHub Authentication when redirected. + set PATH=%APPVEYOR_BUILD_FOLDER%\downloads\doxygen-1.8.14;C:\msys64\%COMPILER_ID%\bin;C:\msys64\usr\bin\;%PATH% + curl --version + cd %APPVEYOR_BUILD_FOLDER% + - git submodule update --init --recursive + +# Assumes that we use the vx.y.z tagging scheme (e.g. v1.3.0) +before_build: + - cmd: | + if defined APPVEYOR_REPO_TAG_NAME (set CI_REPO_VERSION=%APPVEYOR_REPO_TAG_NAME:~1%) else (set CI_REPO_VERSION=latest) + set BUILD_SOURCE_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CI_REPO_VERSION%-src.zip + 7z a -xr!*\.git/ -tzip %BUILD_SOURCE_ARCHIVE% %APPVEYOR_BUILD_FOLDER% + C:\msys64\usr\bin\md5sum.exe -b %BUILD_SOURCE_ARCHIVE% > %BUILD_SOURCE_ARCHIVE%.md5 + C:\msys64\usr\bin\sha256sum.exe -b %BUILD_SOURCE_ARCHIVE% > %BUILD_SOURCE_ARCHIVE%.sha256 + mkdir %APPVEYOR_BUILD_FOLDER%\downloads + rem set DOWNLOAD_FILE_DOXYGEN=doxygen-1.8.14.windows.x64.bin.zip + rem appveyor DownloadFile https://sourceforge.net/projects/doxygen/files/rel-1.8.14/%DOWNLOAD_FILE_DOXYGEN% -FileName %DOWNLOAD_FILE_DOXYGEN% + rem 7z x %DOWNLOAD_FILE_DOXYGEN% -o%APPVEYOR_BUILD_FOLDER%\downloads\doxygen-1.8.14 + rem doxygen --version + rem ############## + if defined APPVEYOR_REPO_TAG_NAME (set SUPERGLU_REPO_VERSION=%SUPERGLU_VERSION%) else (set SUPERGLU_REPO_VERSION=latest) + if defined APPVEYOR_REPO_TAG_NAME (set SUPERGLU_REPO_TAG_NAME=v%SUPERGLU_VERSION%) else (set SUPERGLU_REPO_TAG_NAME=CI-builds) + set DOWNLOAD_FILE_SUPERGLU=superglu-%SUPERGLU_REPO_VERSION%-%COMPILER_ID%-%CMAKE_PLATFORM%.zip + for /f %%i in ('curl -s -H "Authorization: token %GH_AUTH_TOKEN%" https://api.github.com/repos/coin3d/superglu/releases ^| jq -r --arg SUPERGLU_REPO_TAG_NAME "%SUPERGLU_REPO_TAG_NAME%" ".[] | select(.tag_name==$SUPERGLU_REPO_TAG_NAME) | .id"') do set RELEASE_ID=%%i + for /f %%i in ('curl -s -H "Authorization: token %GH_AUTH_TOKEN%" https://api.github.com/repos/coin3d/superglu/releases/%RELEASE_ID% ^| jq -r --arg DOWNLOAD_FILE_SUPERGLU "%DOWNLOAD_FILE_SUPERGLU%" ".assets[] | select(.name==$DOWNLOAD_FILE_SUPERGLU) | .id"') do set ASSET_ID=%%i + set DOWNLOAD_ADDRESS_SUPERGLU=https://api.github.com/repos/coin3d/superglu/releases/assets/%ASSET_ID% + echo download file %DOWNLOAD_FILE_SUPERGLU% from address %DOWNLOAD_ADDRESS_SUPERGLU% + curl -s -S -L -H "Authorization: token %GH_AUTH_TOKEN%" -H "Accept: application/octet-stream" -o %DOWNLOAD_FILE_SUPERGLU% %DOWNLOAD_ADDRESS_SUPERGLU% + 7z x %DOWNLOAD_FILE_SUPERGLU% -o%APPVEYOR_BUILD_FOLDER%\downloads + rem ############## + if defined APPVEYOR_REPO_TAG_NAME (set COIN_REPO_VERSION=%COIN_VERSION%) else (set COIN_REPO_VERSION=latest) + if defined APPVEYOR_REPO_TAG_NAME (set COIN_REPO_TAG_NAME=v%COIN_VERSION%) else (set COIN_REPO_TAG_NAME=CI-builds) + set DOWNLOAD_FILE_COIN=coin-%COIN_REPO_VERSION%-%COMPILER_ID%-%CMAKE_PLATFORM%.zip + for /f %%i in ('curl -s -H "Authorization: token %GH_AUTH_TOKEN%" https://api.github.com/repos/coin3d/coin/releases ^| jq -r --arg COIN_REPO_TAG_NAME "%COIN_REPO_TAG_NAME%" ".[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id"') do set RELEASE_ID=%%i + for /f %%i in ('curl -s -H "Authorization: token %GH_AUTH_TOKEN%" https://api.github.com/repos/coin3d/coin/releases/%RELEASE_ID% ^| jq -r --arg DOWNLOAD_FILE_COIN "%DOWNLOAD_FILE_COIN%" ".assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id"') do set ASSET_ID=%%i + set DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/%ASSET_ID% + echo download file %DOWNLOAD_FILE_COIN% from address %DOWNLOAD_ADDRESS_COIN% + curl -s -S -L -H "Authorization: token %GH_AUTH_TOKEN%" -H "Accept: application/octet-stream" -o %DOWNLOAD_FILE_COIN% %DOWNLOAD_ADDRESS_COIN% + 7z x %DOWNLOAD_FILE_COIN% -o%APPVEYOR_BUILD_FOLDER%\downloads + rem ############## + cmake -H. -Bbuild -G "%CMAKE_GENERATOR%" -A %CMAKE_ARCHITECTURE% -DwxWidgets_ROOT_DIR=%APPVEYOR_BUILD_FOLDER%\downloads -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\Coin3D -DCMAKE_PREFIX_PATH=%APPVEYOR_BUILD_FOLDER%\downloads\Coin3D + - sh: | + if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export CI_REPO_VERSION=${APPVEYOR_REPO_TAG_NAME:1}; else export CI_REPO_VERSION=latest; fi + BUILD_SOURCE_ARCHIVE=$APPVEYOR_PROJECT_NAME-$CI_REPO_VERSION-src.tar.gz + if [ ! -d "$APPVEYOR_BUILD_FOLDER/../$APPVEYOR_PROJECT_NAME" ]; then cp -r $APPVEYOR_BUILD_FOLDER $APPVEYOR_BUILD_FOLDER/../$APPVEYOR_PROJECT_NAME; fi + cd $APPVEYOR_BUILD_FOLDER/.. + tar czf $BUILD_SOURCE_ARCHIVE --exclude .git $APPVEYOR_PROJECT_NAME + mv $BUILD_SOURCE_ARCHIVE $APPVEYOR_BUILD_FOLDER + cd $APPVEYOR_BUILD_FOLDER + md5sum -b $BUILD_SOURCE_ARCHIVE > $BUILD_SOURCE_ARCHIVE.md5 + sha256sum -b $BUILD_SOURCE_ARCHIVE > $BUILD_SOURCE_ARCHIVE.sha256 + mkdir $APPVEYOR_BUILD_FOLDER/downloads + if [ "$COMPILER_ID" != "clang" ]; then export COMPILER_ID=$APPVEYOR_BUILD_WORKER_IMAGE-$COMPILER_ID`$COMPILER_ID -dumpversion | tr '.' '\n'`; fi + if [ "$COMPILER_ID" = "clang" ]; then export COMPILER_ID=$APPVEYOR_BUILD_WORKER_IMAGE-$COMPILER_ID`$COMPILER_ID -v 2>&1 | grep version | sed 's/^.*version \([0-9]*\)\.[0-9]*\.[0-9]*.*$/\1/g'`; fi + ############### + # if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export SUPERGLU_REPO_VERSION=$SUPERGLU_VERSION; else export SUPERGLU_REPO_VERSION=latest; fi + # if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export SUPERGLU_REPO_TAG_NAME=v$SUPERGLU_VERSION; else export SUPERGLU_REPO_TAG_NAME=CI-builds; fi + # DOWNLOAD_FILE_SUPERGLU=superglu-$SUPERGLU_REPO_VERSION-$COMPILER_ID-$CMAKE_PLATFORM.tar.gz + # RELEASE_ID=`curl -s -H "Authorization: token $GH_AUTH_TOKEN" https://api.github.com/repos/coin3d/superglu/releases | jq -r --arg SUPERGLU_REPO_TAG_NAME "$SUPERGLU_REPO_TAG_NAME" '.[] | select(.tag_name==$SUPERGLU_REPO_TAG_NAME) | .id'` + # ASSET_ID=`curl -s -H "Authorization: token $GH_AUTH_TOKEN" https://api.github.com/repos/coin3d/superglu/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_SUPERGLU "$DOWNLOAD_FILE_SUPERGLU" '.assets[] | select(.name==$DOWNLOAD_FILE_SUPERGLU) | .id'` + # export DOWNLOAD_ADDRESS_SUPERGLU=https://api.github.com/repos/coin3d/superglu/releases/assets/$ASSET_ID + # echo download file $DOWNLOAD_FILE_SUPERGLU from address $DOWNLOAD_ADDRESS_SUPERGLU + # curl -s -S -L -H "Authorization: token $GH_AUTH_TOKEN" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_SUPERGLU $DOWNLOAD_ADDRESS_SUPERGLU + # tar xzf $DOWNLOAD_FILE_SUPERGLU -C $APPVEYOR_BUILD_FOLDER/downloads + ############### + if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export COIN_REPO_VERSION=$COIN_VERSION; else export COIN_REPO_VERSION=latest; fi + if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export COIN_REPO_TAG_NAME=v$COIN_VERSION; else export COIN_REPO_TAG_NAME=CI-builds; fi + DOWNLOAD_FILE_COIN=coin-$COIN_REPO_VERSION-$COMPILER_ID-$CMAKE_PLATFORM.tar.gz + RELEASE_ID=`curl -s -H "Authorization: token $GH_AUTH_TOKEN" https://api.github.com/repos/coin3d/coin/releases | jq -r --arg COIN_REPO_TAG_NAME "$COIN_REPO_TAG_NAME" '.[] | select(.tag_name==$COIN_REPO_TAG_NAME) | .id'` + ASSET_ID=`curl -s -H "Authorization: token $GH_AUTH_TOKEN" https://api.github.com/repos/coin3d/coin/releases/$RELEASE_ID | jq -r --arg DOWNLOAD_FILE_COIN "$DOWNLOAD_FILE_COIN" '.assets[] | select(.name==$DOWNLOAD_FILE_COIN) | .id'` + export DOWNLOAD_ADDRESS_COIN=https://api.github.com/repos/coin3d/coin/releases/assets/$ASSET_ID + echo download file $DOWNLOAD_FILE_COIN from address $DOWNLOAD_ADDRESS_COIN + curl -s -S -L -H "Authorization: token $GH_AUTH_TOKEN" -H "Accept: application/octet-stream" -o $DOWNLOAD_FILE_COIN $DOWNLOAD_ADDRESS_COIN + tar xzf $DOWNLOAD_FILE_COIN -C $APPVEYOR_BUILD_FOLDER/downloads + ############### + export CFLAGS=$CMAKE_ARCH_FLAGS + export CXXFLAGS=$CMAKE_ARCH_FLAGS + #cmake -H. -Bbuild_debug -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/Coin3D -DCMAKE_PREFIX_PATH=$APPVEYOR_BUILD_FOLDER/downloads/Coin3D + cmake -H. -Bbuild_release -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/Coin3D -DCMAKE_PREFIX_PATH=$APPVEYOR_BUILD_FOLDER/downloads/Coin3D + +build_script: + - cmd: | + set BUILD_TOOL_OPTIONS=/nologo /verbosity:minimal /maxcpucount /property:MultiProcessorCompilation=true;CL_MPCount=3 + cmake --build build --target INSTALL --config Debug -- %BUILD_TOOL_OPTIONS% + cmake --build build --target INSTALL --config Release -- %BUILD_TOOL_OPTIONS% + - sh: | + BUILD_TOOL_OPTIONS=-j4 + #cmake --build build_debug --target install --config Debug -- $BUILD_TOOL_OPTIONS + cmake --build build_release --target install --config Release -- $BUILD_TOOL_OPTIONS + +after_build: + - cmd: | + cd %APPVEYOR_BUILD_FOLDER% + if defined APPVEYOR_REPO_TAG_NAME (set CI_REPO_VERSION=%APPVEYOR_REPO_TAG_NAME:~1%) else (set CI_REPO_VERSION=latest) + set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CI_REPO_VERSION%-%COMPILER_ID%-%CMAKE_PLATFORM%.zip + 7z a -tzip %BUILD_ARCHIVE% Coin3D + C:\msys64\usr\bin\md5sum.exe -b %BUILD_ARCHIVE% > %BUILD_ARCHIVE%.md5 + C:\msys64\usr\bin\sha256sum.exe -b %BUILD_ARCHIVE% > %BUILD_ARCHIVE%.sha256 + appveyor DownloadFile https://ci.appveyor.com/api/buildjobs/%APPVEYOR_JOB_ID%/log -FileName %APPVEYOR_PROJECT_NAME%-%CI_REPO_VERSION%-%COMPILER_ID%-%CMAKE_PLATFORM%.log + - sh: | + cd $APPVEYOR_BUILD_FOLDER + if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then export CI_REPO_VERSION=${APPVEYOR_REPO_TAG_NAME:1}; else export CI_REPO_VERSION=latest; fi + BUILD_ARCHIVE=$APPVEYOR_PROJECT_NAME-$CI_REPO_VERSION-$COMPILER_ID-$CMAKE_PLATFORM.tar.gz + tar czf $BUILD_ARCHIVE Coin3D/* + md5sum -b $BUILD_ARCHIVE > $BUILD_ARCHIVE.md5 + sha256sum -b $BUILD_ARCHIVE > $BUILD_ARCHIVE.sha256 + appveyor DownloadFile https://ci.appveyor.com/api/buildjobs/$APPVEYOR_JOB_ID/log -FileName $APPVEYOR_PROJECT_NAME-$CI_REPO_VERSION-$COMPILER_ID-$CMAKE_PLATFORM.log + +artifacts: + - path: $(APPVEYOR_PROJECT_NAME)*.zip + name: CIArchives + - path: $(APPVEYOR_PROJECT_NAME)*.tar.gz + name: CIArchivesTGZ + - path: $(APPVEYOR_PROJECT_NAME)*.log + name: logs + - path: $(APPVEYOR_PROJECT_NAME)*.md5 + name: CImd5 + - path: $(APPVEYOR_PROJECT_NAME)*.sha256 + name: CIsha256 + +#test_script: +# - cmd: | +# cd build +# ctest -C Release -VV +# - sh: | +# cd build_release +# ctest -C Release -VV + +notifications: + - provider: Email + to: + - '{{commitAuthorEmail}}' + - coin-support@coin3d.org + on_build_success: false + on_build_failure: true + on_build_status_changed: true + +deploy: + # Deploy to GitHub Releases + - provider: GitHub + auth_token: + secure: 850frgRGZcc4Cljd2P7Ej68no4/kkl4EMB+DjnX725wcKBRJuFk/kGRdJGyKXd2u # your encrypted token from GitHub + artifact: CIArchives, CIArchivesTGZ, CImd5, CIsha256, logs + tag: 'CI builds' + description: 'Results of CI builds for various platforms' + draft: false + prerelease: true + force_update: true + on: + APPVEYOR_REPO_TAG: false # deploy on untagged builds only +# branch: master # release from master branch only + + # Deploy to GitHub Releases + - provider: GitHub + auth_token: + secure: 850frgRGZcc4Cljd2P7Ej68no4/kkl4EMB+DjnX725wcKBRJuFk/kGRdJGyKXd2u # your encrypted token from GitHub + artifact: CIArchives, CIArchivesTGZ, CImd5, CIsha256 + tag: $(APPVEYOR_REPO_TAG_NAME) + description: 'Release build' + draft: true + prerelease: true + force_update: true + on: + APPVEYOR_REPO_TAG: true # deploy on tag push only