diff --git a/.travis.yml b/.travis.yml index 65d3b2ba..aec36607 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ cache: directories: - $TRAVIS_BUILD_DIR/node_modules - $TRAVIS_BUILD_DIR/bower_components - - $HOME/boost_1_61_0/boost - - $HOME/boost_1_61_0/stage/lib + - $HOME/boost_1_62_0/boost + - $HOME/boost_1_62_0/stage/lib install: # Use GCC 5. @@ -51,8 +51,8 @@ install: - export PATH="./node_modules/.bin:$PATH" # Install runtime dependencies using Bower - bower install - - chmod +x scripts/travis/install_boost.sh - - scripts/travis/install_boost.sh + - wget https://raw.githubusercontent.com/WrinklyNinja/ci-scripts/1.0.0/install_boost.py + - python install_boost.py --directory ~ --boost-version 1.62.0 atomic chrono date_time filesystem iostreams locale log regex system thread # Install packages for generating documentation - pip install --user sphinx breathe sphinx_rtd_theme # Add sphinx-build to PATH @@ -70,7 +70,7 @@ before_script: # Move into the cloned LOOT repo build path. - cd build # Link dynamically to the C++ standard library runtime. - - cmake .. -DBOOST_ROOT=~/boost_1_61_0 + - cmake .. -DBOOST_ROOT=~/boost_1_62_0 script: - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm test; fi diff --git a/appveyor.yml b/appveyor.yml index dcc8fa53..d64dc84d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,8 +7,8 @@ configuration: Release cache: - node_modules - bower_components - - C:\projects\boost_1_61_0\boost - - C:\projects\boost_1_61_0\stage\lib + - C:\projects\boost_1_62_0\boost + - C:\projects\boost_1_62_0\stage\lib environment: github_auth_token: @@ -21,7 +21,9 @@ install: - python -m pip install sphinx breathe sphinx_rtd_theme - npm install - .\node_modules\.bin\bower install - - ps: .\scripts\appveyor\install_boost.ps1 + - ps: (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/WrinklyNinja/ci-scripts/1.0.0/install_boost.py', "$env:APPVEYOR_BUILD_FOLDER\install_boost.py") + - ps: (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/WrinklyNinja/ci-scripts/1.0.0/delete_old_bintray_versions.py', "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py") + - python %APPVEYOR_BUILD_FOLDER%\install_boost.py --directory C:\projects --boost-version 1.62.0 atomic chrono date_time filesystem iostreams locale log regex system thread before_build: - cd %APPVEYOR_BUILD_FOLDER% @@ -29,7 +31,7 @@ before_build: - set PATH=C:\ProgramData\chocolatey\lib\imagemagick.tool\tools;%PATH%;C:\Program Files\Inkscape - node scripts\create_ico.js - cd build - - cmake .. -G "Visual Studio 14 2015" -DBOOST_ROOT="C:\projects\boost_1_61_0" + - cmake .. -G "Visual Studio 14 2015" -DBOOST_ROOT="C:\projects\boost_1_62_0" build: verbosity: minimal @@ -113,7 +115,9 @@ deploy: appveyor_repo_tag: true on_success: - - ps: scripts\appveyor\delete_old_artifacts.ps1 + - ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p LOOT -t $env:bintray_auth_token -n 40 + - ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p LOOT_API -t $env:bintray_auth_token -n 40 + - ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -o loot -g loot -u wrinklyninja -b loot -p metadata-validator -t $env:bintray_auth_token -n 40 - ps: scripts\appveyor\update_masterlist_branches.ps1 on_finish: diff --git a/scripts/appveyor/delete_old_artifacts.ps1 b/scripts/appveyor/delete_old_artifacts.ps1 deleted file mode 100644 index 9106d216..00000000 --- a/scripts/appveyor/delete_old_artifacts.ps1 +++ /dev/null @@ -1,93 +0,0 @@ -function Get-HashFromBintrayVersion($version) { - return $version.split('-')[2].split('_')[0].substring(1) -} - -function Get-BranchFromBintrayVersion($version) { - return $version.substring($version.IndexOf('_') + 1) -} - -function Get-Branches($versions) { - $branches = @() - foreach ($version in $versions) { - $branches += Get-BranchFromBintrayVersion $version - } - - return $branches | select -uniq -} - -function Is-Merged($commitId) { - $branches = [array](git branch --contains $commitId) - - return ($branches -contains ' dev') -Or ($branches -contains '* dev') -} - -function Get-VersionsForBranch($versions, $branch) { - $branchVersions = @() - foreach ($version in $versions) { - $versionBranch = Get-BranchFromBintrayVersion $version - if ($versionBranch -eq $branch) { - $branchVersions += $version - } - } - return $branchVersions -} - -function Get-AuthorizationHeaderValue($username, $password) { - $credentials = "$($username):$($password)" - return 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($credentials)) -} - -$currentBranch = $env:APPVEYOR_REPO_BRANCH -$bintrayToken = $env:bintray_auth_token -$bintrayRepoUrl = 'https://api.bintray.com/packages/wrinklyninja/loot' -$bintrayHeaders = @{ Authorization = (Get-AuthorizationHeaderValue 'wrinklyninja' $bintrayToken) } -$packages = @( - 'LOOT' - 'LOOT_API' - 'metadata-validator' -) -# The GitHub API's protected branches API is currently in preview, so hardcode -# the branches for now. -$protectedBranches = @( - 'dev' - 'master' -) - -foreach($package in $packages) { - $bintrayPackageUrl = "$bintrayRepoUrl/$package" - $versions = (Invoke-RestMethod -Uri $bintrayPackageUrl).versions - - $versionsToDelete = @() - $versionsToKeep = @() - - foreach ($branch in (Get-Branches $versions)) { - if ($protectedBranches -contains $branch) { - continue - } - - $branchVersions = @(Get-VersionsForBranch $versions $branch) - if (Is-Merged (Get-HashFromBintrayVersion $branchVersions[0])) { - $versionsToDelete += $branchVersions - } else { - $versionsToKeep += $branchVersions[0] - } - } - - # Get the versions not marked for deletion or keeping. - $unevaluatedVersions = @() - foreach ($version in $versions) { - if (!($versionsToDelete -contains $version) -And !($versionsToKeep -contains $version)) { - $unevaluatedVersions += $version - } - } - - $firstOldVersionIndex = 40 - $versionsToKeep.length - if ($unevaluatedVersions.length -gt $firstOldVersionIndex) { - $versionsToDelete += $unevaluatedVersions[$firstOldVersionIndex..($unevaluatedVersions.length - 1)] - } - - foreach ($version in $versionsToDelete) { - Write-Output "Deleting from Bintray: $version" - Invoke-RestMethod -Method Delete -Uri "$bintrayPackageUrl/versions/$version" -Headers $bintrayHeaders - } -} diff --git a/scripts/appveyor/install_boost.ps1 b/scripts/appveyor/install_boost.ps1 deleted file mode 100644 index 587f89a4..00000000 --- a/scripts/appveyor/install_boost.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -# Assumes that 'C:\projects' exists and that 7-zip is installed and 7z.exe is -# available on the PATH. - -Add-Type -AssemblyName System.IO.Compression.FileSystem - -$boostUrl = 'https://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.7z?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.61.0%2F&ts=1468862599&use_mirror=ncu' -$boostArchive = 'C:\projects\boost_1_61_0.7z' -$boostFolder = 'C:\projects\boost_1_61_0' -$boostLibraries = @( - 'libboost_atomic-vc140-mt-1_61.lib' - 'libboost_chrono-vc140-mt-1_61.lib' - 'libboost_date_time-vc140-mt-1_61.lib' - 'libboost_filesystem-vc140-mt-1_61.lib' - 'libboost_iostreams-vc140-mt-1_61.lib' - 'libboost_locale-vc140-mt-1_61.lib' - 'libboost_log_setup-vc140-mt-1_61.lib' - 'libboost_log-vc140-mt-1_61.lib' - 'libboost_regex-vc140-mt-1_61.lib' - 'libboost_system-vc140-mt-1_61.lib' - 'libboost_thread-vc140-mt-1_61.lib' -) - -function Is-LibraryMissing { - $libFolder = $boostFolder + '\stage\lib' - foreach($library in $boostLibraries) { - if (!(Test-Path ($libFolder + '\' + $library))) { - return $true - } - } - - return $false -} - -if (Is-LibraryMissing) { - Write-Output 'Downloading Boost 1.61.0...' - - $start_time = Get-Date - (New-Object System.Net.WebClient).DownloadFile($boostUrl, $boostArchive) - - Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)" - - Remove-Item -Recurse -Force $boostFolder - - Write-Output 'Extracting ' + $boostArchive + '...' - cd - 7z x $boostArchive -o"C:\projects" - - cd $boostFolder - .\bootstrap.bat - .\b2 toolset=msvc threadapi=win32 link=static variant=release address-model=32 --with-log --with-date_time --with-thread --with-filesystem --with-locale --with-regex --with-system --with-iostreams -} diff --git a/scripts/travis/install_boost.sh b/scripts/travis/install_boost.sh deleted file mode 100644 index 34ce8820..00000000 --- a/scripts/travis/install_boost.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -BOOST_BASENAME=boost_1_61_0 -BOOST_LIBRARIES=(libboost_atomic.a libboost_chrono.a libboost_date_time.a libboost_filesystem.a libboost_iostreams.a libboost_locale.a libboost_log.a libboost_log_setup.a libboost_regex.a libboost_system.a libboost_thread.a) - -function isLibraryMissing { - for LIBRARY in $BOOST_LIBRARIES; do - if [[ ! -e ~/$BOOST_BASENAME/stage/lib/$LIBRARY ]]; then - return 0 - fi - done - - return 1 -} - -if isLibraryMissing; then - cd ~ - - wget https://downloads.sourceforge.net/project/boost/boost/1.61.0/${BOOST_BASENAME}.tar.bz2 - rm -rf $BOOST_BASENAME - tar xf ${BOOST_BASENAME}.tar.bz2 - - cd $BOOST_BASENAME - ./bootstrap.sh - ./b2 toolset=gcc-5 link=static variant=release address-model=64 cxxflags="-std=c++14 -fPIC" boost.locale.icu=off --with-log --with-date_time --with-thread --with-filesystem --with-locale --with-regex --with-system --with-iostreams -fi