From 29066d2fe4b1d0bf69b87123f86f70ca3d7f2ae3 Mon Sep 17 00:00:00 2001 From: Angela Wang Date: Fri, 4 Apr 2025 21:04:43 -0400 Subject: [PATCH 1/3] try tex workflow --- .github/workflows/compile-and-push-tex.yml | 59 ++++++++++++++-------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/.github/workflows/compile-and-push-tex.yml b/.github/workflows/compile-and-push-tex.yml index 20c0e3e5..9efdcd70 100644 --- a/.github/workflows/compile-and-push-tex.yml +++ b/.github/workflows/compile-and-push-tex.yml @@ -2,8 +2,8 @@ name: Compile and push LaTeX files on: push: - branches: - - main + # branches: + # - main paths: - 'docs/**/*.tex' @@ -11,6 +11,8 @@ concurrency: group: ${{ github.ref }} # Group by branch reference (e.g., 'refs/heads/main') cancel-in-progress: true +permissions: + contents: write jobs: build: @@ -18,26 +20,39 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Install LaTeX (pdflatex) - run: sudo apt-get update && sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-science - - - name: Compile PDFs - run: cd docs && make - - - name: Commit changes + - name: Get changed LaTeX files + id: latex-files run: | - git config --global user.name "github-actions" - git config --global user.email "github-actions@github.com" - git add . - git commit -m "Add generated PDF files" || echo "No changes to commit" - - - name: Push changes - run: | - git push origin $GITHUB_REF - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- docs/**/*.tex | xargs) + echo "Changed files: $CHANGED_FILES" + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + CHANGED_FILENAMES=$(for file in $CHANGED_FILES; do basename "$file"; done | xargs) + echo "CHANGED_FILENAMES=$CHANGED_FILENAMES" >> $GITHUB_ENV + FILE_COUNT=$(echo $CHANGED_FILENAMES | wc -w) + if [ $FILE_COUNT -gt 1 ]; then + PLURAL_S='s' + else + PLURAL_S='' + fi + echo "PLURAL_S=$PLURAL_S" >> $GITHUB_ENV + - uses: xu-cheng/texlive-action@v2 + name: Compile LaTeX Files + with: + scheme: full + texlive_version: 2024 + run: | + apk add make + cd docs + for file in ${{ env.CHANGED_FILES }}; do + dir=$(dirname "$file" | cut -d'/' -f2-) + make -B "$dir/$(basename "$file" .tex).pdf" + done + - name: Commit and push PDFs + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'Add/Update PDF${{ env.PLURAL_S }} for changed LaTeX file${{ env.PLURAL_S }}: ${{ env.CHANGED_FILENAMES }}' + file_pattern: 'docs/*.pdf' + branch: main \ No newline at end of file From 284c5debf388880538eb6c0f50721a41e97f8cd3 Mon Sep 17 00:00:00 2001 From: Angela Wang Date: Fri, 4 Apr 2025 21:05:40 -0400 Subject: [PATCH 2/3] noop --- docs/Design/SoftDetailedDes/MIS.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Design/SoftDetailedDes/MIS.tex b/docs/Design/SoftDetailedDes/MIS.tex index 9013db42..2b1d3e64 100644 --- a/docs/Design/SoftDetailedDes/MIS.tex +++ b/docs/Design/SoftDetailedDes/MIS.tex @@ -20,6 +20,7 @@ \usepackage{caption} \usepackage{fullpage} + \hypersetup{ bookmarks=true, % show bookmarks bar? colorlinks=true, % false: boxed links; true: colored links From 0be269946c0dd903a04296fd05eb48c917a3e22d Mon Sep 17 00:00:00 2001 From: Angela Wang Date: Fri, 4 Apr 2025 21:14:33 -0400 Subject: [PATCH 3/3] main branch --- .github/workflows/compile-and-push-tex.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-and-push-tex.yml b/.github/workflows/compile-and-push-tex.yml index 9efdcd70..791f3d22 100644 --- a/.github/workflows/compile-and-push-tex.yml +++ b/.github/workflows/compile-and-push-tex.yml @@ -2,8 +2,8 @@ name: Compile and push LaTeX files on: push: - # branches: - # - main + branches: + - main paths: - 'docs/**/*.tex'