Update Nightly Toolchain #36
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 Nightly Toolchain | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 9 * * *' | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: nightly-testing | |
| token: ${{ secrets.UNICODE_BASIC_TOKEN }} | |
| - name: install jq | |
| uses: dcarbone/install-jq-action@v3 | |
| - name: set user | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
| - name: get toochain tags | |
| id: toolchain-tag | |
| run: | | |
| LEAN_TAG=$(curl -s "https://api.github.com/repos/leanprover/lean4-nightly/releases" | jq -r '.[0].tag_name') | |
| REPO_TAG=$(cut -d ':' -f2 lean-toolchain | tr -d '\n') | |
| echo "lean_tag=$LEAN_TAG" >> $GITHUB_OUTPUT | |
| echo "repo_tag=$REPO_TAG" >> $GITHUB_OUTPUT | |
| - name: commit and push | |
| if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }} | |
| run: | | |
| echo "leanprover/lean4:${{ steps.toolchain-tag.outputs.lean_tag }}" > lean-toolchain | |
| git add lean-toolchain | |
| git commit -m "chore: update toolchain ${{ steps.toolchain-tag.outputs.lean_tag }}" | |
| git push origin nightly-testing |