forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (34 loc) · 1.45 KB
/
nightly_bump_toolchain.yml
File metadata and controls
39 lines (34 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Bump lean-toolchain on nightly-testing
on:
schedule:
- cron: '0 10/3 * * *'
# Run every three hours, starting at 11AM CET/2AM PT.
# This should be 3 hours after lean4 starts building its nightly,
# and 15 minutes after batteries `nightly-testing` branch bumps its toolchain.
workflow_dispatch:
jobs:
update-toolchain:
runs-on: ubuntu-latest
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
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 "leanprover-community-mathlib4-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
git push origin nightly-testing