-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (42 loc) · 1.65 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Build LaTeX documents
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Set up Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
shell: bash
run: git fetch --tags -f
- name: Install XeLaTeX
shell: bash
run: sudo apt-get install -y latexmk texlive-xetex texlive-science texlive-lang-german
- name: Build LaTeX documents
shell: bash
run: |
mkdir $GITHUB_WORKSPACE/latex-output
find . -name '*.tex' \( -exec latexmk -synctex=1 -xelatex -interaction=nonstopmode -outdir=$GITHUB_WORKSPACE/latex-output -cd "$PWD"/{} \; -o -print \)
- name: Deploy
if: ${{ github.event_name == 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="nightly"
git tag -f "$TAG"
gh release delete "$TAG" || true
gh release create -t "Nightly PDF build" -n "This release always contains the PDFs built from the latest .tex source. It is advised to only use the latest versions for actual exams, as old versions might contain factual errors." "$TAG"
for file in $GITHUB_WORKSPACE/latex-output/*.pdf; do
echo "Delivering file $file"
gh release upload "$TAG" "$file" --clobber
done