diff --git a/.github/workflows/nightly-test.yml b/.github/workflows/nightly-test.yml new file mode 100644 index 0000000..9083436 --- /dev/null +++ b/.github/workflows/nightly-test.yml @@ -0,0 +1,39 @@ +name: Bump lean-toolchain on nightly-testing + +on: + workflow_dispatch: + # schedule: + # - cron: '0 10/3 * * *' # Run every three hours, starting at 11AM CET/2AM PT. + +jobs: + update-toolchain: + runs-on: ubuntu-latest + + steps: + - name: Check out 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 "verso-lean-bot" + git config user.email "verso-lean-bot@users.noreply.github.com" + git add lean-toolchain + # Don't fail if there's nothing to commit + git commit -m "chore: bump to ${RELEASE_TAG}" || true + # rebase on top of main - this branch should only contain toolchain updates + git fetch origin/main + git rebase origin/main + git push -f origin nightly-testing