Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install elan
run: |
curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \
| sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> $GITHUB_PATH

- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Lean toolchain
uses: actions/cache@v4
with:
path: ~/.elan
key: elan-${{ hashFiles('lean-toolchain') }}

- name: Cache Lake packages
uses: actions/cache@v4
with:
path: .lake
key: lake-${{ hashFiles('lake-manifest.json') }}
restore-keys: lake-

- name: Build project
run: lake build

- name: Generate book
run: lake exe generate-book
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install elan
run: |
curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \
| sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> $GITHUB_PATH

- name: Checkout repository
uses: actions/checkout@v4

- name: Cache Lean toolchain
uses: actions/cache@v4
with:
path: ~/.elan
key: elan-${{ hashFiles('lean-toolchain') }}

- name: Cache Lake packages
uses: actions/cache@v4
with:
path: .lake
key: lake-${{ hashFiles('lake-manifest.json') }}
restore-keys: lake-

- name: Build project
run: lake build

- name: Generate book
run: lake exe generate-book

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _out/html-multi/

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion Book/v4_31_0.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ New functionalities coming in Lean 4.31.0
```
```leanOutput vers
Lean 4.31.0-rc1
Target: arm64-apple-darwin24.6.0 macOS
Target: x86_64-unknown-linux-gnu
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ lake exe generate-book
```

The generated site will be in `_out/html-multi/`.

### Note for local build
`Book/v4_31_0.lean` contains a `#version` output assertion that is platform-specific. The expected output is set to `x86_64-unknown-linux-gnu` to match the GitHub Actions CI environment. Running `lake build` locally on macOS will fail on this file. This is intentional — the file is maintained and verified through CI only. If you need to run it locally, change it by your local target.

Loading