From ac12b4d8703c500787b00be457a70bd086ccaa44 Mon Sep 17 00:00:00 2001 From: Haidong Wang Date: Fri, 20 Nov 2026 10:15:47 +0800 Subject: [PATCH 1/2] Update aerial.yml --- .github/workflows/aerial.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aerial.yml b/.github/workflows/aerial.yml index 0a1b27a8..fb7d0fec 100644 --- a/.github/workflows/aerial.yml +++ b/.github/workflows/aerial.yml @@ -1,5 +1,6 @@ name: Build Aerial Thesis on: + workflow_dispatch: push: paths: - 'aerial/undergraduate/**' @@ -17,9 +18,8 @@ jobs: uses: actions/checkout@v4 - name: Fix line endings (CRLF → LF) run: | - cd aerial/undergraduate - sed -i 's/\r$//' hutbthesis.cls - sed -i 's/\r$//' hutbthesis_main.tex + sed -i 's/\r$//' aerial/undergraduate/hutbthesis.cls + sed -i 's/\r$//' aerial/undergraduate/hutbthesis_main.tex - name: Compile LaTeX Thesis uses: xu-cheng/latex-action@v3 with: From 6952ba12bb38e2d08944d0c35e83269ff98dbb80 Mon Sep 17 00:00:00 2001 From: Haidong Wang Date: Fri, 20 Nov 2026 10:21:39 +0800 Subject: [PATCH 2/2] Refactor GitHub Actions workflow for LaTeX compilation --- .github/workflows/aerial.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/aerial.yml b/.github/workflows/aerial.yml index fb7d0fec..60d3125e 100644 --- a/.github/workflows/aerial.yml +++ b/.github/workflows/aerial.yml @@ -11,23 +11,30 @@ on: - '.github/workflows/aerial.yml' jobs: - build: + work: runs-on: ubuntu-latest steps: - - name: Checkout source - uses: actions/checkout@v4 - - name: Fix line endings (CRLF → LF) - run: | - sed -i 's/\r$//' aerial/undergraduate/hutbthesis.cls - sed -i 's/\r$//' aerial/undergraduate/hutbthesis_main.tex - - name: Compile LaTeX Thesis + - uses: actions/checkout@v4 + with: + # github action 默认签出只包含最后一次提交 + # 解决方案参考:https://stackoverflow.com/questions/62334460/git-history-in-a-github-action + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Compile aerial LaTeX document uses: xu-cheng/latex-action@v3 with: - root_file: aerial/undergraduate/hutbthesis_main.tex + working_directory: aerial/undergraduate + root_file: hutbthesis_main.tex + texlive_version: 2023 latexmk_use_xelatex: true - args: "-shell-escape" - - name: Upload compiled PDF - uses: actions/upload-artifact@v4 + # 下载安装Times New Roman字体 + pre_compile: | + apk add msttcorefonts-installer fontconfig + update-ms-fonts + fc-cache -f + - uses: actions/upload-artifact@v4 with: - name: aerial-thesis-pdf - path: aerial/undergraduate/*.pdf + name: aerial + path: | + aerial/undergraduate/hutbthesis_main.pdf