Skip to content

Commit

Permalink
rename root tex file and use github.repository as prefix #10 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhomm authored Aug 5, 2024
1 parent 0b9653b commit c4a7c0b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ jobs:
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Get Repository Name
id: repo_name
run: |
ls -lrt
prefix=$(echo "${{ github.repository }}" | cut -d'/' -f2)
echo "prefix=$prefix" >> "$GITHUB_OUTPUT"
echo "pdf=$prefix-${{ github.ref_name }}.pdf" >> "$GITHUB_OUTPUT"
echo "tex=$prefix.tex" >> "$GITHUB_OUTPUT"
- name: Install hooks
run: |
sh ./setup-hooks.sh
git checkout ${{ github.ref }} # checkout the branch or tag to update gitinfo2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: main.tex
root_file: ${{ steps.repo_name.outputs.tex }}
latexmk_shell_escape: true
post_compile: "latexmk -c; rm -rf _minted*"

- name: Get Repository Name
id: repo_name
run: |
ls -lrt
prefix=$(echo "${{ github.repository }}" | cut -d'/' -f2)
echo "prefix=$prefix" >> "$GITHUB_OUTPUT"
echo "pdf=$prefix-${{ github.ref_name }}.pdf" >> "$GITHUB_OUTPUT"
-
name: Rename PDF
run: |
mv main.pdf ${{ steps.repo_name.outputs.pdf }}
mv ${{ steps.repo_name.outputs.prefix }}.pdf ${{ steps.repo_name.outputs.pdf }}
- name: Upload PDF
uses: actions/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ _minted*
*.blg
*.out
*.pyg
*.fls
*.synctex.gz
main.pdf
*.toc
article.template.pdf
*.fdb_latexmk
File renamed without changes.

0 comments on commit c4a7c0b

Please sign in to comment.