diff --git a/.appveyor.yml b/.appveyor.yml index f080f241a9..6b8671c1f6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -26,7 +26,7 @@ build_script: cmake --build .) - if %CFG% == MINGW64 (C:\msys64\usr\bin\bash -lc "exec 0 diff.md - ./script/diff_changelogs.py <(git show $last_tag:doc/changes.md) doc/changes.md >> diff.md - gothub release -s $GH_TOKEN -u leanprover -r lean-nightly -t $LEAN_VERSION_STRING -d - --pre-release < diff.md -fi - -if [ $rev = $(git rev-parse --short $LEAN_VERSION_STRING) ] -then - gothub upload -s $GH_TOKEN -u leanprover -r lean-nightly -t $LEAN_VERSION_STRING -n "$(basename $1)" -f "$1" -fi - -# LEGACY binary in gh-pages branch. Remove when test scripts are changed to use versioned nightlies. -# inspired by https://github.com/steveklabnik/automatically_update_github_pages_with_travis_example - -git checkout -b gh-pages nightly/gh-pages -cd gh-pages - -mkdir -p build -ln -f ../build/lean-* build/ - -git add -A . -git commit --amend --reset-author -m "nightly build at ${rev}" -git push -fq +[ -n $LEAN_VERSION_STRING ] && gothub upload -s $GH_TOKEN -u leanprover -r lean-nightly -t $LEAN_VERSION_STRING -n "$(basename $1)" -f "$1" diff --git a/script/setup_nightly.sh b/script/setup_nightly.sh new file mode 100644 index 0000000000..f3e3031649 --- /dev/null +++ b/script/setup_nightly.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -eu + +git remote add nightly "https://$GH_TOKEN@github.com/leanprover/lean-nightly.git" +git fetch nightly + +# exit if commit is already tagged +git describe --exact-match --tags HEAD >& /dev/null && return + +# Travis can't publish releases to other repos (or stop mucking with the markdown description), so push releases directly +go get github.com/itchio/gothub + +if git tag $LEAN_VERSION_STRING +then + # technically a race condition... + git push nightly $LEAN_VERSION_STRING + last_tag=$(git describe @^ --abbrev=0 --tags) + echo -e "Changes since ${last_tag}:\n\n" > diff.md + ./script/diff_changelogs.py <(git show $last_tag:doc/changes.md) doc/changes.md >> diff.md + gothub release -s $GH_TOKEN -u leanprover -r lean-nightly -t $LEAN_VERSION_STRING -d - --pre-release < diff.md +else + # make sure every runner is building the same commit + git checkout $LEAN_VERSION_STRING +fi + +LEAN_VERSION_STRING="nightly-$(date -uI)" +OPTIONS+="-DLEAN_VERSION_STRING=$LEAN_VERSION_STRING"