Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
Try doing some basic maths questions in the Lean Theorem Prover. Functions, real numbers, equivalence relations and groups. Click on README.md and then on "Open in CoCalc with one click".
Project: Xena
Views: 18536License: APACHE
set -e # fail on error12DEPLOY_NIGHTLY_GITHUB_USER=leanprover-community-bot3git remote add mathlib "https://$DEPLOY_NIGHTLY_GITHUB_USER:$DEPLOY_NIGHTLY_GITHUB_TOKEN@github.com/leanprover-community/mathlib.git"4git remote add nightly "https://$DEPLOY_NIGHTLY_GITHUB_USER:$DEPLOY_NIGHTLY_GITHUB_TOKEN@github.com/leanprover-community/mathlib-nightly.git"56# After this point, we don't use any secrets in commands.7set -x # echo commands89# By default, github actions overrides the credentials used to access any10# github url so that it uses the github-actions[bot] user. We want to access11# github using a different username.12git config --unset http.https://github.com/.extraheader1314# The checkout action produces a shallow repository from which we cannot push.15git fetch --unshallow || true1617git fetch nightly --tags1819# Create a tag name based on the current date.20MATHLIB_VERSION_STRING="nightly-$(date -u +%F)"2122# Check if the tag already exists. If so, exit (successfully).23# This way we create a release/update the lean-x.y.z branch24# only once per day.25if git rev-parse --verify -q $MATHLIB_VERSION_STRING; then26exit 027fi2829if command -v greadlink >/dev/null 2>&1; then30# macOS readlink doesn't support -f option31READLINK=greadlink32else33READLINK=readlink34fi3536# Try to update the lean-x.y.z branch on mathlib. This could fail if37# a subsequent commit has already pushed an update.38LEAN_VERSION="lean-3.4.2"3940git push mathlib HEAD:refs/heads/$LEAN_VERSION || \41echo "mathlib rejected push to branch $LEAN_VERSION; maybe it already has a later version?" >&24243# Push the commits to a branch on nightly and push a tag.44git push nightly HEAD:"mathlib-master" || true45git tag $MATHLIB_VERSION_STRING46git push nightly tag $MATHLIB_VERSION_STRING4748# Travis can't publish releases to other repos (or stop mucking with the markdown description), so push releases directly49export GOPATH=$($READLINK -f go)50PATH=$PATH:$GOPATH/bin51go get github.com/itchio/gothub5253# Build olean and script tarballs.54OLEAN_ARCHIVE=mathlib-olean-$MATHLIB_VERSION_STRING.tar.gz55SCRIPT_ARCHIVE=mathlib-scripts-$MATHLIB_VERSION_STRING.tar.gz56git clone https://github.com/leanprover-community/mathlib-tools57tar czf $OLEAN_ARCHIVE src58rm -rf mathlib-scripts59cp -a mathlib-tools/scripts mathlib-scripts60tar czf $SCRIPT_ARCHIVE mathlib-scripts61ls *.tar.gz6263# Create a release associated with the tag and upload the tarballs.64export GITHUB_TOKEN=$DEPLOY_NIGHTLY_GITHUB_TOKEN65gothub release -u leanprover-community -r mathlib-nightly -t $MATHLIB_VERSION_STRING -d "Mathlib's .olean files and scripts" --pre-release66gothub upload -u leanprover-community -r mathlib-nightly -t $MATHLIB_VERSION_STRING -n "$(basename $OLEAN_ARCHIVE)" -f "$OLEAN_ARCHIVE"67gothub upload -u leanprover-community -r mathlib-nightly -t $MATHLIB_VERSION_STRING -n "$(basename $SCRIPT_ARCHIVE)" -f "$SCRIPT_ARCHIVE"686970