From 06131530b283ef307c81d7350eabeb75c4c287ac Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:19:53 +0200 Subject: [PATCH 1/6] pages --- .github/workflows/deploy.yml | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..719bdab --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,66 @@ +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: + # Install elan (Lean version manager) + - 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 + + # Cache the Lean toolchain and Lake packages + - 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 \ No newline at end of file From 507a7f9c9f8c84bd0327574e9e1d8f3da35bad2a Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:24:47 +0200 Subject: [PATCH 2/6] check build on pull request --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 719bdab..1e85f17 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main workflow_dispatch: permissions: From 2c39b8840ae906947f803154b3391d0f888b9f07 Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:33:06 +0200 Subject: [PATCH 3/6] Pages: target agnostic --- Book/v4_31_0.lean | 1 - 1 file changed, 1 deletion(-) diff --git a/Book/v4_31_0.lean b/Book/v4_31_0.lean index 82c8b4d..58c1cfa 100644 --- a/Book/v4_31_0.lean +++ b/Book/v4_31_0.lean @@ -16,5 +16,4 @@ New functionalities coming in Lean 4.31.0 ``` ```leanOutput vers Lean 4.31.0-rc1 -Target: arm64-apple-darwin24.6.0 macOS ``` From 2578bed84b73a76588b258a152af6a1e48b4e425 Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:41:32 +0200 Subject: [PATCH 4/6] Pages: change the target explicitly --- Book/v4_31_0.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Book/v4_31_0.lean b/Book/v4_31_0.lean index 58c1cfa..b63bce4 100644 --- a/Book/v4_31_0.lean +++ b/Book/v4_31_0.lean @@ -16,4 +16,5 @@ New functionalities coming in Lean 4.31.0 ``` ```leanOutput vers Lean 4.31.0-rc1 +Target: x86_64-unknown-linux-gnu ``` From fd914da90604073e808fcb93cf5df0b92d1ae7d9 Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:49:20 +0200 Subject: [PATCH 5/6] Pages: note in readme for local build --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 64bc298..8d4e304 100644 --- a/README.md +++ b/README.md @@ -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. + From 355189a17b7ad8fba03378eb18232f0d877efb76 Mon Sep 17 00:00:00 2001 From: j-mayoral Date: Sun, 7 Jun 2026 16:55:54 +0200 Subject: [PATCH 6/6] Pages: split build and deploy jobs --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 27 +++++++++++-------------- 2 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5db3ed1 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1e85f17..e2b2907 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,62 +1,57 @@ name: Deploy to GitHub Pages - + on: push: branches: - main - pull_request: - 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: - # Install elan (Lean version manager) - 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 - - # Cache the Lean toolchain and Lake packages + - 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