diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6f48eb2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ + +language: generic + +env: + global: + - CMAKE_GENERATOR="Unix Makefiles" CMAKE_OPTIONS=" " + +matrix: + include: + - os: linux + dist: trusty + sudo: required + env: BUILD_PLATFORM="Linux-x64" + - os: osx + osx_image: xcode7.3 + env: BUILD_PLATFORM="Darwin-x64" + +install: + - buildscripts/1-install-deps-travis.sh + - export PATH="/data/bin:$PATH" + +script: + - CMAKE_BUILD_TYPE=Debug buildscripts/2-build-travis.sh + - CMAKE_BUILD_TYPE=Release buildscripts/2-build-travis.sh + +after_success: + - CMAKE_BUILD_TYPE=Debug buildscripts/3-release-travis.sh + - CMAKE_BUILD_TYPE=Release buildscripts/3-release-travis.sh + + diff --git a/appveyor.yml b/appveyor.yml new file mode 100755 index 0000000..7dd16f8 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,34 @@ + +version: 1.0.{branch}-{build} + +image: Visual Studio 2015 + +clone_depth: 5 + +skip_tags: true + +configuration: + - Release + - Debug + +platform: + - x64 +# - x86 + +environment: + matrix: + - PROFILE: MSVC2015 + CMAKE_GENERATOR: "Visual Studio 14 2015 Win64" + CMAKE_OPTIONS: " " + +install: + - bash buildscripts\1-install-deps-appveyor.sh + - refreshenv + - set PATH=%APPVEYOR_BUILD_FOLDER%\temp;%PATH% + +build_script: + - bash buildscripts\2-build-appveyor.sh + +on_success: + - bash buildscripts\3-release-appveyor.sh + diff --git a/buildscripts/1-install-deps-appveyor.sh b/buildscripts/1-install-deps-appveyor.sh new file mode 100755 index 0000000..61f3d93 --- /dev/null +++ b/buildscripts/1-install-deps-appveyor.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -x +set -e +set -u + +mkdir temp +cd temp + +curl -fsSL -o github-release.tar.gz https://github.com/paulthomson/github-release/releases/download/v1.0.9.1/github-release_v1.0.9.1_windows_amd64.tar.gz + +7z x github-release.tar.gz +7z x github-release.tar +cd .. + +mkdir deps +cd deps +curl -fsSL -o angle.zip https://github.com/paulthomson/build-angle/releases/download/v-6d5336347c750def8c0447d055a7368262431508/MSVC2015-Release-x64.zip +7z x angle.zip + diff --git a/buildscripts/1-install-deps-travis.sh b/buildscripts/1-install-deps-travis.sh new file mode 100755 index 0000000..311e708 --- /dev/null +++ b/buildscripts/1-install-deps-travis.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -x +set -e +set -u + +sudo mkdir -p /data/bin +sudo chmod uga+rwx /data/bin + +GITHUB_RELEASE_TOOL_USER="paulthomson" +GITHUB_RELEASE_TOOL_VERSION="v1.0.9.1" + + +mkdir deps +cd deps + +if [ "$(uname)" == "Darwin" ]; +then + GITHUB_RELEASE_TOOL_ARCH="darwin_amd64" + wget https://github.com/paulthomson/build-angle/releases/download/v-592879ad24e66c7c68c3a06d4e2227630520da36/Darwin-x64-Release.zip + unzip Darwin-x64-Release.zip +fi + +if [ "$(uname)" == "Linux" ]; +then + GITHUB_RELEASE_TOOL_ARCH="linux_amd64" + wget https://github.com/paulthomson/build-angle/releases/download/v-592879ad24e66c7c68c3a06d4e2227630520da36/Linux-x64-Release.zip + unzip Linux-x64-Release.zip +fi + +cd .. + + +pushd /data/bin +wget "https://github.com/${GITHUB_RELEASE_TOOL_USER}/github-release/releases/download/${GITHUB_RELEASE_TOOL_VERSION}/github-release_${GITHUB_RELEASE_TOOL_VERSION}_${GITHUB_RELEASE_TOOL_ARCH}.tar.gz" +tar xf "github-release_${GITHUB_RELEASE_TOOL_VERSION}_${GITHUB_RELEASE_TOOL_ARCH}.tar.gz" +popd + + diff --git a/buildscripts/2-build-appveyor.sh b/buildscripts/2-build-appveyor.sh new file mode 100755 index 0000000..065b733 --- /dev/null +++ b/buildscripts/2-build-appveyor.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -x +set -e +set -u + + +CMAKE_BUILD_TYPE="${Configuration}" +INSTALL_DIR="${PROFILE}-${Platform}-${CMAKE_BUILD_TYPE}" +BUILD_DIR="$INSTALL_DIR-build" + +mkdir -p "${BUILD_DIR}" +cd "${BUILD_DIR}" +cmake -G "${CMAKE_GENERATOR}" .. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" ${CMAKE_OPTIONS} +cmake --build . --config "${CMAKE_BUILD_TYPE}" +cmake "-DCMAKE_INSTALL_PREFIX=../${INSTALL_DIR}" "-DBUILD_TYPE=${CMAKE_BUILD_TYPE}" -P cmake_install.cmake +cd .. + diff --git a/buildscripts/2-build-travis.sh b/buildscripts/2-build-travis.sh new file mode 100755 index 0000000..7d2f9c2 --- /dev/null +++ b/buildscripts/2-build-travis.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -x +set -e +set -u + +INSTALL_DIR="${BUILD_PLATFORM}-${CMAKE_BUILD_TYPE}" +BUILD_DIR="${INSTALL_DIR}-build" + + +mkdir -p "${BUILD_DIR}" +cd "${BUILD_DIR}" +cmake -G "${CMAKE_GENERATOR}" .. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" -DCMAKE_OSX_ARCHITECTURES=x86_64 ${CMAKE_OPTIONS} +cmake --build . --config "${CMAKE_BUILD_TYPE}" +cmake "-DCMAKE_INSTALL_PREFIX=../${INSTALL_DIR}" "-DBUILD_TYPE=${CMAKE_BUILD_TYPE}" -P cmake_install.cmake +cd .. + + diff --git a/buildscripts/3-release-appveyor.sh b/buildscripts/3-release-appveyor.sh new file mode 100755 index 0000000..c957e6b --- /dev/null +++ b/buildscripts/3-release-appveyor.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -x +set -e +set -u + +shopt -s extglob +shopt -s nullglob + +CMAKE_BUILD_TYPE="${Configuration}" +INSTALL_DIR="${PROFILE}-${Platform}-${CMAKE_BUILD_TYPE}" +COMMIT_ID="${APPVEYOR_REPO_COMMIT}" + +cd "${INSTALL_DIR}" +7z a "../${INSTALL_DIR}.zip" * +cd .. + +github-release \ + graphicsfuzz/get-image-egl \ + "v-${COMMIT_ID}" \ + "${COMMIT_ID}" \ + "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" \ + "${INSTALL_DIR}.zip" + diff --git a/buildscripts/3-release-travis.sh b/buildscripts/3-release-travis.sh new file mode 100755 index 0000000..57d764d --- /dev/null +++ b/buildscripts/3-release-travis.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -x +set -e +set -u + +shopt -s extglob +shopt -s nullglob + +INSTALL_DIR="${BUILD_PLATFORM}-${CMAKE_BUILD_TYPE}" +COMMIT_ID="${TRAVIS_COMMIT}" + +cd "${INSTALL_DIR}" +zip -r ../"${INSTALL_DIR}.zip" * +cd .. + +github-release \ + graphicsfuzz/get-image-egl \ + "v-${COMMIT_ID}" \ + "${COMMIT_ID}" \ + "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" \ + "${INSTALL_DIR}.zip" + +