From fd9bc662e79df3d9b60b3fbff5ffc726fc54a172 Mon Sep 17 00:00:00 2001 From: Snowball_233 Date: Fri, 23 Jan 2026 00:32:37 +0800 Subject: [PATCH] =?UTF-8?q?t=20push=20feat:=20=E5=AE=8C=E5=96=84=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/epub.yml | 104 ++++++++++++++++++++----------------- book.toml | 2 +- 2 files changed, 56 insertions(+), 50 deletions(-) diff --git a/.github/workflows/epub.yml b/.github/workflows/epub.yml index b3edf9ac..8b9b7036 100644 --- a/.github/workflows/epub.yml +++ b/.github/workflows/epub.yml @@ -1,56 +1,62 @@ name: epub on: - push: - branches: - - main - - epub - workflow_dispatch: + push: + branches: + - epub + workflow_dispatch: permissions: - contents: read + contents: read jobs: - build: - name: Build EPUB and PDF - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install Tectonic - uses: wtfjoke/setup-tectonic@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Pandoc and Fonts - run: | - sudo apt-get update - sudo apt-get install -y pandoc fonts-noto-cjk - - - name: Install mdbook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: "latest" - - - name: Install mdbook-pandoc - run: | - cargo install mdbook-pandoc - - - name: Build Book - run: mdbook build - - - name: List Output Directory - if: always() - run: find book -maxdepth 4 - - - name: Upload EPUB - uses: actions/upload-artifact@v4 - with: - name: rust-course-epub - path: book/pandoc/epub/rust-course.epub - - - name: Upload PDF - uses: actions/upload-artifact@v4 - with: - name: rust-course-pdf - path: book/pandoc/pdf/rust-course.pdf + build: + name: Build EPUB and PDF + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install mdbook + uses: peaceiris/actions-mdbook@v2 + with: + mdbook-version: "latest" + + - name: Install Pandoc + uses: pandoc/actions/setup@v3 + with: + version: "3.1" + + - name: Install Tectonic + uses: wtfjoke/setup-tectonic@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install fonts + run: | + sudo apt-get update + sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra + + - name: Install mdbook-pandoc + run: | + cargo install mdbook-pandoc + + - name: Build Book + run: mdbook build + + - name: List Output Directory + if: always() + run: find book -maxdepth 4 + + - name: Upload EPUB + if: success() + uses: actions/upload-artifact@v4 + with: + name: rust-course-epub + path: book/pandoc/epub/rust-course.epub + + - name: Upload PDF + if: success() + uses: actions/upload-artifact@v4 + with: + name: rust-course-pdf + path: book/pandoc/pdf/rust-course.pdf diff --git a/book.toml b/book.toml index 6a7d433e..cc8720f7 100644 --- a/book.toml +++ b/book.toml @@ -29,7 +29,7 @@ disabled = false output-file = "rust-course.pdf" pdf-engine = "tectonic" to = "pdf" -variables = { mainfont = "Noto Sans CJK SC", sansfont = "Noto Sans CJK SC" } +variables = { mainfont = "Noto Sans CJK SC", sansfont = "Noto Sans CJK SC", CJKmainfont = "Noto Sans CJK SC" } [output.pandoc.profile.epub] output-file = "rust-course.epub"