aboutsummaryrefslogtreecommitdiff
path: root/.build.yml
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2020-10-25 16:43:56 -0600
committerMelody Horn <melody@boringcactus.com>2020-10-25 16:43:56 -0600
commitde1a54d2d475301c2c7d4f7d2b876daa419d3d58 (patch)
treed713284339c37e374f5ad48d29323ccc6cf1c4b7 /.build.yml
parentae7bcb4277d6ce225516bcf36ef07451fe2be2ee (diff)
downloadspec-de1a54d2d475301c2c7d4f7d2b876daa419d3d58.tar.gz
spec-de1a54d2d475301c2c7d4f7d2b876daa419d3d58.zip
split build into better stages
Diffstat (limited to '.build.yml')
-rw-r--r--.build.yml18
1 files changed, 10 insertions, 8 deletions
diff --git a/.build.yml b/.build.yml
index 5af08b4..63ad596 100644
--- a/.build.yml
+++ b/.build.yml
@@ -5,28 +5,30 @@ packages:
- poppler-utils
sources:
- https://git.sr.ht/~boringcactus/crowbar-spec
+environment:
+ files: "index vs-c tagged-unions types safety errors syntax LICENSE"
tasks:
- - page-count: |
+ - build-html: |
cd crowbar-spec
- files="index vs-c tagged-unions types safety errors syntax LICENSE"
- html_files=""
i=0
for file in $files
do
pandoc --defaults=etc/md.yml --number-offset=$i -o $file.html $file.md
- html_files="$html_files $file.html"
i=$((i+1))
done
+ tar czvf ../spec-html.tar.gz *.html
+ - build-pdf: |
+ cd crowbar-spec
if git describe --tags --exact-match 2>/dev/null
then
metadata="subtitle=$(git describe --tags --exact-match)"
else
metadata="version=$(git log -1 --no-decorate --oneline)"
fi
- pandoc --defaults=etc/pdf.yml -o ../spec.pdf -M $metadata $html_files
- cd ..
- pdfinfo spec.pdf | grep Pages
- tar czvf spec-html.tar.gz crowbar-spec/*.html
+ pandoc --defaults=etc/pdf.yml -o ../spec.pdf -M "$metadata" $(echo files | awk '{ for (i=1; i<=NF; i++) printf "%s.html ", $i }')
+ - test-page-count: |
+ pages=$(pdfinfo spec.pdf | grep Pages | awk -f '{ print $2 }')
+ test pages -le 200
artifacts:
- spec.pdf
- spec-html.tar.gz