From da2597610d8c7c09ad8572990f080b1e58150339 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 24 Jan 2020 01:13:03 +1100 Subject: [PATCH] CI: test artifact system --- .travis/after_success.sh | 20 ++++++++++---------- appveyor-build.bat | 25 ++++++++++++++++++++++++- appveyor.yml | 3 --- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.travis/after_success.sh b/.travis/after_success.sh index 95e2457ff..dbcdfe15e 100644 --- a/.travis/after_success.sh +++ b/.travis/after_success.sh @@ -20,22 +20,22 @@ if [ "$TRAVIS_TAG" != "" || "$REMOTE" == "$LOCAL" ] then echo "[INFO] Still current. Uploading..." - # retrieve upload tool - #wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + # Retrieve upload tool + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - #if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - # upload final package - #bash upload.sh Olive*.zip + upload final package + bash upload.sh Olive*.zip - #elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - #find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - # upload final package - #bash upload.sh Olive*.AppImage* + # Upload final package + bash upload.sh Olive*.AppImage* - #fi + fi else diff --git a/appveyor-build.bat b/appveyor-build.bat index 607510ea4..c22230b72 100644 --- a/appveyor-build.bat +++ b/appveyor-build.bat @@ -1,11 +1,13 @@ REM Get git hash in variable [this seems to be the most efficient way] git rev-parse --short=8 HEAD > hash.txt +git rev-parse HEAD > longhash.txt set /p GITHASH= < hash.txt +set /p GITLONGHASH= < longhash.txt REM Set up Visual Studio x64 environment call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -REM Install 64-bit +REM Install 64-bit packages set VCPKG_DEFAULT_TRIPLET=x64-windows REM Hack to only install release builds for time @@ -78,6 +80,27 @@ REM Create portable copy nul olive-editor\portable 7z a %PKGNAME%.zip olive-editor +REM We're ready to upload, but we only upload *sometimes* +REM set PATH=%PATH%;C:\msys64\usr\bin + +REM If this was a tagged build, upload +if "%APPVEYOR_REPO_TAG%"=="true" GOTO upload + +REM Else, if this is a continuous build, check if this commit is the most recent +curl -H "Authorization: token %GITHUB_TOKEN%" https://api.github.com/repos/olive-editor/olive/commits/master > repoinfo.txt +grep -Po '(?^<=: \")(([a-z0-9])\w+)(?=\")' -m 1 repoinfo.txt > latestcommit.txt +set /p REMOTEHASH= < latestcommit.txt +if "%REMOTEHASH%"=="%GITLONGHASH%" GOTO upload + +REM The previous if statements failed, skip to the end +GOTO end + +:upload +wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh +bash upload.sh Olive*.zip +bash upload.sh Olive*.exe + +:end REM Check if this build should set up a debugging session IF "%ENABLE_RDP%"=="1" ( powershell -command "$blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))" diff --git a/appveyor.yml b/appveyor.yml index bf249984e..18b9df5e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,4 @@ version: "{build}" -branches: - only: - - master image: Visual Studio 2017 environment: TRAVIS_REPO_SLUG: olive-editor/olive