pandoc-latex-template/.github/workflows/build-examples.yml
Pascal Wagler b3f3066f3b
fix: Merge changes from pandoc 3.4 LaTeX template (#395)
fix: Merge changes from pandoc 3.4 LaTeX template

* Merge changes from the pandoc default LaTeX template from version 3.4 (7e8aafa).
* prepare for release of version 2.5.0
* update copyright year
* fix: Update `actions/upload-artifact` to version `v4`
* run ci with pandoc 3.4
* run ci with python 3.12
2024-10-03 14:29:09 +02:00

76 lines
3.3 KiB
YAML

name: Build Example PDF files
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup pandoc
env:
PANDOC_VERSION: "3.4"
run: |
wget -qO- https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | sudo tar xzf - --strip-components 1 -C /usr/local/
- name: Setup TexLive
env:
REMOTE: http://mirror.ctan.org/systems/texlive/tlnet
INSTALL: '/tmp/install-texlive'
run: |
mkdir -p ${INSTALL}
curl -sSL ${REMOTE}/install-tl-unx.tar.gz | tar -xzv -C $INSTALL --strip-components=1
sudo ${INSTALL}/install-tl -no-gui -profile .texlife.profile
VERSION=$($INSTALL/install-tl --version | grep 'version' | grep -o '[0-9]\{4\}')
PLATFORM=$($INSTALL/install-tl --print-platform)
TEXLIVE_DIR="/usr/local/texlive/${VERSION}"
TEXBIN="/usr/local/texlive/${VERSION}/bin/${PLATFORM}"
echo "${TEXBIN}" >> $GITHUB_PATH
sudo chown -hR $(whoami) "$TEXLIVE_DIR"
- name: Initialization for tlmgr
run: |
sudo apt-get update -qq && sudo apt-get install xzdec -y
tlmgr init-usertree
- name: Setup fonts and image convertion tool
run: sudo apt-get update -qq && sudo apt-get install fonts-noto-cjk poppler-utils -y
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install python filters
run: |
python -m pip install --upgrade pip
pip install pandoc-latex-environment
- name: Install LaTeX packages
run: |
tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl hardwrap catchfile
# trial and error
tlmgr install letltxmacro zref everypage framed collectbox
# packages needed for the template
tlmgr install xecjk filehook unicode-math ucharcat pagecolor babel-german ly1 mweights sourcecodepro sourcesanspro mdframed needspace fvextra footmisc footnotebackref background
# packages only needed for some examples (that include packages via header-includes)
tlmgr install awesomebox fontawesome5
# packages only needed for some examples (example boxes-with-pandoc-latex-environment-and-tcolorbox)
tlmgr install tcolorbox pgf etoolbox environ trimspaces
- name: Build examples
run: cd examples && bash build-examples.sh && cd ..
- name: Add generated example files
uses: actions/upload-artifact@v4
with:
name: build-files
path: |
examples/*/document.pdf
examples/*/preview.png
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Add generated example files" -a
- name: Push changes
uses: ad-m/github-push-action@master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}