56 lines
1.6 KiB
YAML
Raw Normal View History

2025-01-20 11:19:08 -08:00
on:
push:
pull_request:
workflow_run:
name: Build and deploy
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
2025-01-21 17:09:22 -08:00
# Could instead install `texlive-full`, but that takes ~20 minutes.
# We'll specify the packages we need manually.
- name: "Install TeXLive"
2025-01-21 15:53:19 -08:00
run: |
2025-01-21 16:05:20 -08:00
sudo apt update
2025-01-21 16:46:23 -08:00
DEBIAN_FRONTEND=noninteractive \
sudo apt install --yes \
2025-01-21 17:22:36 -08:00
texlive texlive-xetex \
texlive-games texlive-fonts-extra texlive-latex-extra \
2025-01-21 17:31:43 -08:00
texlive-pictures texlive-pstricks
2025-01-21 15:58:40 -08:00
2025-01-21 17:09:22 -08:00
- name: "Download Typst"
2025-01-21 16:25:24 -08:00
run: |
2025-01-21 17:31:43 -08:00
wget -q "https://github.com/typst/typst/releases/download/v0.12.0/typst-x86_64-unknown-linux-musl.tar.xz"
2025-01-21 16:25:24 -08:00
tar -xf "typst-x86_64-unknown-linux-musl.tar.xz"
mv "typst-x86_64-unknown-linux-musl/typst" .
2025-01-21 16:46:23 -08:00
rm "typst-x86_64-unknown-linux-musl.tar.xz"
rm -dr "typst-x86_64-unknown-linux-musl"
2025-01-20 11:19:08 -08:00
2025-01-21 17:09:22 -08:00
# Builds all handouts, LaTeX and Typst
- name: "Build handouts"
2025-01-21 16:38:03 -08:00
run: TYPST_PATH="$(pwd)/typst" python tools/build/main.py
2025-01-20 11:19:08 -08:00
2025-01-21 17:09:22 -08:00
# Upload logs, even if build fails.
# LaTeX stdout/stderr isn't always helpful.
- name: "Upload LaTeX logs"
2025-01-21 17:02:48 -08:00
uses: actions/upload-artifact@v3
if: always()
with:
2025-01-21 17:09:22 -08:00
name: "LaTeX logs"
path: "**/*.log"
2025-01-21 17:02:48 -08:00
retention-days: 1
2025-01-21 17:09:22 -08:00
# Upload build output
- name: "Upload output"
2025-01-21 17:02:48 -08:00
uses: actions/upload-artifact@v3
2025-01-20 11:19:08 -08:00
with:
name: output
path: "output/*"
retention-days: 10