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 new file mode 100644 index 0000000..e2b2907 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 \ No newline at end of file diff --git a/Book/v4_31_0.lean b/Book/v4_31_0.lean index 82c8b4d..b63bce4 100644 --- a/Book/v4_31_0.lean +++ b/Book/v4_31_0.lean @@ -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 ``` 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. +