27 lines
1.4 KiB
Bash
27 lines
1.4 KiB
Bash
#!/bin/sh
|
|
# Compile disposable copies; never refresh the frozen source's canonical PDFs/index.
|
|
set -eu
|
|
source=/workspace/demo/tikzrefinery
|
|
out=/output/report
|
|
mkdir -p "$out/source" "$out/results"
|
|
cp -a "$source/." "$out/source/"
|
|
cd "$out/source/documents/latex"
|
|
for edition in TikZRefinerySubmission TikZRefinery; do
|
|
folder="$out/results/$edition"
|
|
mkdir -p "$folder"
|
|
echo "Compiling $edition: LaTeX, bibliography, index and cross-references"
|
|
if ! latexmk -pdf -interaction=nonstopmode -halt-on-error -file-line-error \
|
|
-outdir="$folder" "$edition.tex" > "$folder/console.txt" 2>&1; then
|
|
tail -60 "$folder/console.txt"; exit 1
|
|
fi
|
|
if grep -Eq '(^!|undefined references|undefined citations|Citation .* undefined|Reference .* undefined|Rerun to get cross-references right|Label\(s\) may have changed)' "$folder/$edition.log"; then
|
|
echo "Unresolved report diagnostics: $edition" >&2; exit 1
|
|
fi
|
|
test -s "$folder/$edition.pdf"
|
|
done
|
|
# The upstream checker binds its index to all source inputs and final shipout maps.
|
|
python3 ../update-diagram-index.py --build-directory "$out/results" --record-sources
|
|
python3 ../update-diagram-index.py --build-directory "$out/results"
|
|
cp "$out/results/TikZRefinerySubmission/TikZRefinerySubmission.pdf" /output/artifacts/TikZRefinery-report.pdf
|
|
cp ../diagram-index.json /output/artifacts/diagram-index.json
|