diff --git a/.gitignore b/.gitignore index c93ff36a9..a07b6ed06 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,8 @@ _book/ *.mobi *.pdf +# templated files +meta.tex + game.db.json .DS_Store diff --git a/build.books.sh b/build.books.sh index 141a13f55..02a2b8621 100755 --- a/build.books.sh +++ b/build.books.sh @@ -2,6 +2,12 @@ set -e +if [ -v GITHUB_REF_NAME ]; then + sed "s/%%FOOTER_VERSION%%/${GITHUB_REF_NAME}/" meta.tmpl.tex > meta.tex +else + sed "s/%%FOOTER_VERSION%%/UNDEFINED VERSION/" meta.tmpl.tex > meta.tex +fi + docker run --rm -v `pwd`:/data uppalabharath/pandoc-latex-cjk:latest --from=gfm+rebase_relative_paths -o learn-go-with-tests.pdf \ -H meta.tex --pdf-engine=xelatex --variable urlcolor=blue --toc --toc-depth=1 \ -B pdf-cover.tex \ diff --git a/meta.tex b/meta.tmpl.tex similarity index 93% rename from meta.tex rename to meta.tmpl.tex index 8cd33510e..738a1695e 100644 --- a/meta.tex +++ b/meta.tmpl.tex @@ -11,4 +11,4 @@ \pagestyle{fancy} \fancyhf{} -\cfoot{v 10.0.0} +\cfoot{%%FOOTER_VERSION%%}