Bump lean-toolchain on nightly-testing #949
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bump lean-toolchain on nightly-testing | |
| on: | |
| schedule: | |
| - cron: '45 9/3 * * *' | |
| # 10:45AM CET/1:45AM PT (and then every 3 hours thereafter), | |
| # This should be 2 hours and 45 minutes after lean4 starts building the nightly. | |
| # Mathlib's `nightly-testing` branch is bumped 15 minutes later. | |
| jobs: | |
| update-toolchain: | |
| if: github.repository_owner == 'leanprover-community' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: nightly-testing # checkout nightly-testing branch | |
| token: ${{ secrets.NIGHTLY_TESTING }} | |
| - name: Get latest release tag from leanprover/lean4-nightly | |
| id: get-latest-release | |
| run: | | |
| RELEASE_TAG=$(curl -s "https://api.github.com/repos/leanprover/lean4-nightly/releases" | jq -r '.[0].tag_name') | |
| echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
| - name: Update lean-toolchain file | |
| run: | | |
| echo "leanprover/lean4:${RELEASE_TAG}" > lean-toolchain | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "leanprover-community-mathlib4-bot" | |
| git config user.email "[email protected]" | |
| git add lean-toolchain | |
| git commit -m "chore: bump to ${RELEASE_TAG}" | |
| git push origin nightly-testing |