Update Toolchain #895
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: Update Toolchain | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 3 * * *' | |
| jobs: | |
| update-toolchain: | |
| name: update toolchain | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: install jq | |
| uses: dcarbone/install-jq-action@v3 | |
| - name: get toolchain tags | |
| id: toolchain-tag | |
| run: | | |
| REPO_TAG=$(sed 's/.*://1' lean-toolchain | tr -d '\n') | |
| LEAN_TAG=$(curl -s "https://api.github.com/repos/leanprover/lean4/releases" | jq -r '.[0].tag_name' | tr -d '\n') | |
| echo "repo_tag=$REPO_TAG" >> $GITHUB_OUTPUT | |
| echo "lean_tag=$LEAN_TAG" >> $GITHUB_OUTPUT | |
| - name: update toolchain | |
| id: update | |
| if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }} | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor_id}}+${{ github.actor }}@users.noreply.github.com" | |
| git merge -X theirs origin/nightly-testing | |
| echo "leanprover/lean4:${{ steps.toolchain-tag.outputs.lean_tag }}" > lean-toolchain | |
| - name: create pull request | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.UNICODE_BASIC_TOKEN }} | |
| commit-message: "chore: update toolchain ${{ steps.toolchain-tag.outputs.lean_tag }}" | |
| branch: update-toolchain-${{ steps.toolchain-tag.outputs.lean_tag }} | |
| delete-branch: true | |
| title: "chore: update toolchain ${{ steps.toolchain-tag.outputs.lean_tag }}" |