mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
* build all moderncv styles in github actions * do correct escaping for sed * prevent .log files from deletion, needed for artifact upload * fix style iteration logic when replacing styles, colorize echo for better visibility * fix colors
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Build template
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
registry_package:
|
|
|
|
jobs:
|
|
build-template:
|
|
name: Build template
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: thomasweise/docker-texlive-full:latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build pdf
|
|
run: |
|
|
prev_style=contemporary
|
|
for style in casual classic banking oldstyle fancy contemporary
|
|
do
|
|
echo -e "\033[1;35mCompiling style $style...\033[0m"
|
|
# first cleanup, but keep .log files for later artifact upload
|
|
latexmk -c -e 'sub cleanup_generated { my $ext = $_[0]; return 0 if $ext eq "log"; return 1; }'
|
|
sed -i "s/moderncvstyle\[\]{${prev_style}}/moderncvstyle\[\]{${style}}/g" template.tex
|
|
latexmk -pdflua ./template.tex
|
|
mv template.pdf template_${style}.pdf
|
|
mv template.log template_${style}.log
|
|
# remember previous style
|
|
prev_style=$style
|
|
done
|
|
|
|
- name: Upload pdf
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: template.pdf
|
|
path: ./template_*.pdf
|
|
|
|
- name: Upload log
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: template.log
|
|
path: ./template_*.log
|