diff --git a/.travis.yml b/.travis.yml index 214bab9..d1e51e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,49 +1,48 @@ language: generic -env: - global: - - CO=f0b30dd8bd2bd68d6aad0e161f5fc3816d5a5077 matrix: include: - os: linux dist: trusty sudo: required - env: BUILD_PLATFORM="Linux-x64" Configuration="Debug" + env: BUILD_PLATFORM="Linux_x64" Configuration="Debug" - os: linux dist: trusty sudo: required - env: BUILD_PLATFORM="Linux-x64" Configuration="Release" + env: BUILD_PLATFORM="Linux_x64" Configuration="Release" - os: osx - osx_image: xcode7.3 - env: BUILD_PLATFORM="Darwin-x64" Configuration="Debug" + osx_image: xcode8.3 + env: BUILD_PLATFORM="Mac_x64" Configuration="Debug" + cache: + directories: + - $HOME/Library/Caches/Homebrew - os: osx - osx_image: xcode7.3 - env: BUILD_PLATFORM="Darwin-x64" Configuration="Release" + osx_image: xcode8.3 + env: BUILD_PLATFORM="Mac_x64" Configuration="Release" + cache: + directories: + - $HOME/Library/Caches/Homebrew install: + - export CLONE_DIR="angle" + - export PATH=/data/bin:/data/depot_tools:$PATH + - export GITHUB_USER="paulthomson" + - export GITHUB_REPO="build-angle" + - export COMMIT_ID="${TRAVIS_COMMIT}" + - export GROUP_DOTS="github.${GITHUB_USER}" + - export GROUP_SLASHES="github/${GITHUB_USER}" + - export ARTIFACT="${GITHUB_REPO}" + - export VERSION="${COMMIT_ID}" + - export POM_FILE="${GITHUB_REPO}-${VERSION}.pom" + - export TAG="${GROUP_SLASHES}/${ARTIFACT}/${VERSION}" + - export CLASSIFIER="${BUILD_PLATFORM}_${Configuration}" + - export INSTALL_DIR="${ARTIFACT}-${VERSION}-${CLASSIFIER}" - ./1-install-deps-travis.sh - - export PATH=/data/bin:$PATH script: - - echo Building ${CO} - - git clone https://github.com/google/angle.git - - wget https://storage.googleapis.com/chrome-infra/depot_tools.zip - - 7z x depot_tools.zip -odepot_tools - - export PATH=$(pwd)/depot_tools:$PATH - - gclient - - export GYP_GENERATORS=ninja - - cd angle - - git checkout ${CO} - - python scripts/bootstrap.py - - gclient sync - - git checkout ${CO} - - ninja -C "out/${Configuration}" - - cd .. + - ./2-build-travis.sh after_success: - - cd angle/out - - INSTALL_DIR="${Configuration}" COMMIT_ID="${TRAVIS_COMMIT}" RELEASE_ZIP="${BUILD_PLATFORM}-${Configuration}" ../../3-release-travis.sh - - + - ./3-release-travis.sh diff --git a/1-install-deps-appveyor.sh b/1-install-deps-appveyor.sh index e06ca64..2251d7a 100755 --- a/1-install-deps-appveyor.sh +++ b/1-install-deps-appveyor.sh @@ -3,13 +3,27 @@ set -x set -e set -u +GITHUB_RELEASE_TOOL_USER="c4milo" +GITHUB_RELEASE_TOOL_VERSION="v1.1.0" +GITHUB_RELEASE_TOOL_ARCH="windows_amd64" + 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 + +curl -fsSL -o github-release.tar.gz "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" 7z x github-release.tar.gz 7z x github-release.tar cd .. +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +cd depot_tools +git checkout 08faab99d41bd4f1f727267586ff28a227f80cd3 +cd .. +git clone https://chromium.googlesource.com/angle/angle "${CLONE_DIR}" +cd "${CLONE_DIR}" +git checkout $(cat ../COMMIT_ID) +python scripts/bootstrap.py +gclient sync diff --git a/1-install-deps-travis.sh b/1-install-deps-travis.sh index d162298..a9e9f7d 100755 --- a/1-install-deps-travis.sh +++ b/1-install-deps-travis.sh @@ -5,14 +5,15 @@ set -u sudo mkdir -p /data/bin sudo chmod uga+rwx /data/bin +sudo chmod uga+rwx /data -GITHUB_RELEASE_TOOL_USER="paulthomson" -GITHUB_RELEASE_TOOL_VERSION="v1.0.9.1" +GITHUB_RELEASE_TOOL_USER="c4milo" +GITHUB_RELEASE_TOOL_VERSION="v1.1.0" if [ "$(uname)" == "Darwin" ]; then - brew install p7zip + brew install p7zip md5sha1sum GITHUB_RELEASE_TOOL_ARCH="darwin_amd64" fi @@ -23,8 +24,19 @@ then GITHUB_RELEASE_TOOL_ARCH="linux_amd64" fi +pushd /data +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +cd depot_tools +git checkout 08faab99d41bd4f1f727267586ff28a227f80cd3 +popd + 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 +git clone https://chromium.googlesource.com/angle/angle "${CLONE_DIR}" +cd "${CLONE_DIR}" +git checkout $(cat ../COMMIT_ID) +python scripts/bootstrap.py +gclient sync diff --git a/2-build-appveyor.sh b/2-build-appveyor.sh new file mode 100755 index 0000000..08aa3f1 --- /dev/null +++ b/2-build-appveyor.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -x +set -e +set -u + +cd "${CLONE_DIR}" + +if [ "${Configuration}" = "Debug" ]; then + IS_DEBUG="true" +else + IS_DEBUG="false" +fi + +gn gen "out/${Configuration}" "--args=is_debug=${IS_DEBUG} target_cpu=\"x64\" is_clang=false" +ninja -C "out/${Configuration}" + +mkdir -p "${INSTALL_DIR}/bin" +mkdir -p "${INSTALL_DIR}/lib" + +cp "out/${Configuration}/libEGL"* "${INSTALL_DIR}/lib/" +cp "out/${Configuration}/libGLES"* "${INSTALL_DIR}/lib/" +cp "out/${Configuration}/shader_translator"* "${INSTALL_DIR}/bin/" diff --git a/2-build-travis.sh b/2-build-travis.sh new file mode 100755 index 0000000..7d4c28e --- /dev/null +++ b/2-build-travis.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -x +set -e +set -u + +cd "${CLONE_DIR}" + +if [ "${Configuration}" = "Debug" ]; then + IS_DEBUG="true" +else + IS_DEBUG="false" +fi + +gn gen "out/${Configuration}" "--args=is_debug=${IS_DEBUG} target_cpu=\"x64\"" +ninja -C "out/${Configuration}" + +mkdir -p "${INSTALL_DIR}/bin" +mkdir -p "${INSTALL_DIR}/lib" + +cp "out/${Configuration}/libEGL"* "${INSTALL_DIR}/lib/" +cp "out/${Configuration}/libGLES"* "${INSTALL_DIR}/lib/" +cp "out/${Configuration}/shader_translator" "${INSTALL_DIR}/bin/" diff --git a/3-release-appveyor.sh b/3-release-appveyor.sh index e43c5d0..abdd8ec 100755 --- a/3-release-appveyor.sh +++ b/3-release-appveyor.sh @@ -3,19 +3,51 @@ set -x set -e set -u +cd "${CLONE_DIR}" -echo "${INSTALL_DIR}" -echo "${COMMIT_ID}" -echo "${RELEASE_ZIP}" +for f in "${INSTALL_DIR}/bin/"* "${INSTALL_DIR}/lib/"*; do + echo "${COMMIT_ID}">"${f}.build-version" + cp ../COMMIT_ID "${f}.version" +done cd "${INSTALL_DIR}" -7z a "../${RELEASE_ZIP}.zip" *.* lib +7z a "../${INSTALL_DIR}.zip" *.* lib cd .. +sha1sum "${INSTALL_DIR}.zip" >"${INSTALL_DIR}.zip.sha1" + +sed -e "s/@GROUP@/${GROUP_DOTS}/g" -e "s/@ARTIFACT@/${ARTIFACT}/g" -e "s/@VERSION@/${VERSION}/g" "../fake_pom.xml" >"${POM_FILE}" +sha1sum "${POM_FILE}" >"${POM_FILE}.sha1" + +DESCRIPTION="$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${INSTALL_DIR}.zip" + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${INSTALL_DIR}.zip.sha1" + +# Don't fail if pom cannot be uploaded, as it might already be there. + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${POM_FILE}" || true + github-release \ - paulthomson/build-angle \ - "v-${COMMIT_ID}" \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ "${COMMIT_ID}" \ - "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" \ - "${RELEASE_ZIP}.zip" + "${DESCRIPTION}" \ + "${POM_FILE}.sha1" || true diff --git a/3-release-travis.sh b/3-release-travis.sh index 464882b..5b0d949 100755 --- a/3-release-travis.sh +++ b/3-release-travis.sh @@ -3,22 +3,51 @@ set -x set -e set -u -shopt -s extglob +cd "${CLONE_DIR}" - -echo "${INSTALL_DIR}" -echo "${COMMIT_ID}" -echo "${RELEASE_ZIP}" +for f in "${INSTALL_DIR}/bin/"* "${INSTALL_DIR}/lib/"*; do + echo "${COMMIT_ID}">"${f}.build-version" + cp ../COMMIT_ID "${f}.version" +done cd "${INSTALL_DIR}" -# All files except "obj" dir -7z a "../${RELEASE_ZIP}.zip" !(obj) +zip -r "../${INSTALL_DIR}.zip" * cd .. +sha1sum "${INSTALL_DIR}.zip" >"${INSTALL_DIR}.zip.sha1" + +sed -e "s/@GROUP@/${GROUP_DOTS}/g" -e "s/@ARTIFACT@/${ARTIFACT}/g" -e "s/@VERSION@/${VERSION}/g" "../fake_pom.xml" >"${POM_FILE}" +sha1sum "${POM_FILE}" >"${POM_FILE}.sha1" + +DESCRIPTION="$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${INSTALL_DIR}.zip" + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${INSTALL_DIR}.zip.sha1" + +# Don't fail if pom cannot be uploaded, as it might already be there. + +github-release \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ + "${COMMIT_ID}" \ + "${DESCRIPTION}" \ + "${POM_FILE}" || true + github-release \ - paulthomson/build-angle \ - "v-${COMMIT_ID}" \ + "${GITHUB_USER}/${GITHUB_REPO}" \ + "${TAG}" \ "${COMMIT_ID}" \ - "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" \ - "${RELEASE_ZIP}.zip" + "${DESCRIPTION}" \ + "${POM_FILE}.sha1" || true diff --git a/COMMIT_ID b/COMMIT_ID new file mode 100644 index 0000000..e44a04e --- /dev/null +++ b/COMMIT_ID @@ -0,0 +1 @@ +c20ead32ad6d97a87ea64f7350f778959be91075 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index b3dc1b8..1d5d058 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,39 +13,30 @@ configuration: platform: - x64 -# - x86 install: - - set BRANCH_TO_CO=f0b30dd8bd2bd68d6aad0e161f5fc3816d5a5077 - - echo Building %BRANCH_TO_CO% - - bash 1-install-deps-appveyor.sh + - set "CLONE_DIR=angle" + - set "PATH=%APPVEYOR_BUILD_FOLDER%\temp;%APPVEYOR_BUILD_FOLDER%\depot_tools;%PATH%" + - set "DEPOT_TOOLS_WIN_TOOLCHAIN=0" + - '"C:\Program Files\Git\bin\sh.exe" --login 1-install-deps-appveyor.sh' - refreshenv - - set PATH=%cd%\temp;%PATH% - - git clone https://github.com/google/angle.git - - ps: Start-FileDownload https://storage.googleapis.com/chrome-infra/depot_tools.zip - - 7z x depot_tools.zip -odepot_tools - - set PATH=%cd%\depot_tools;%PATH% - - gclient - - set GYP_GENERATORS=msvs - - set GYP_MSVS_VERSION=2017 - - cd angle - - git checkout %BRANCH_TO_CO% - - python scripts\bootstrap.py - - gclient sync - - git checkout %BRANCH_TO_CO% - - cd .. + - set "CLONE_DIR=angle" + - set "PATH=%APPVEYOR_BUILD_FOLDER%\temp;%APPVEYOR_BUILD_FOLDER%\depot_tools;%PATH%" + - set "DEPOT_TOOLS_WIN_TOOLCHAIN=0" + - set "GITHUB_USER=paulthomson" + - set "GITHUB_REPO=build-angle" + - set "COMMIT_ID=%APPVEYOR_REPO_COMMIT%" + - set "GROUP_DOTS=github.%GITHUB_USER%" + - set "GROUP_SLASHES=github/%GITHUB_USER%" + - set "ARTIFACT=%GITHUB_REPO%" + - set "VERSION=%COMMIT_ID%" + - set "POM_FILE=%GITHUB_REPO%-%VERSION%.pom" + - set "TAG=%GROUP_SLASHES%/%ARTIFACT%/%VERSION%" + - set "CLASSIFIER=Windows_x64_%Configuration%" + - set "INSTALL_DIR=%ARTIFACT%-%VERSION%-%CLASSIFIER%" build_script: - - msbuild angle\gyp\ANGLE.sln /p:Configuration=%Configuration% /p:Platform=%Platform% /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" & msbuild /version - -#artifacts: -# - path: angle\gyp\Release_x64\shader_translator.exe -# - path: angle\gyp\Release_Win32\shader_translator.exe + - '"C:\Program Files\Git\bin\sh.exe" --login 2-build-appveyor.sh' on_success: - - cd angle\gyp - - set INSTALL_DIR=%Configuration%_%Platform% - - set RELEASE_ZIP=MSVC2017-%Configuration%-%Platform% - - set COMMIT_ID=%APPVEYOR_REPO_COMMIT% - - bash ..\..\3-release-appveyor.sh - + - '"C:\Program Files\Git\bin\sh.exe" --login 3-release-appveyor.sh' diff --git a/fake_pom.xml b/fake_pom.xml new file mode 100644 index 0000000..2507caf --- /dev/null +++ b/fake_pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + @GROUP@ + @ARTIFACT@ + @VERSION@ + pom + + UTF-8 + +