Skip to content

Commit f3760e8

Browse files
authored
Possible solution to set the correct version in the PDF footer when building with GH Actions (#836)
1 parent 11abe1f commit f3760e8

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ _book/
99
*.mobi
1010
*.pdf
1111

12+
# templated files
13+
meta.tex
14+
1215
game.db.json
1316
.DS_Store

build.books.sh

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
set -e
44

5+
if [ -v GITHUB_REF_NAME ]; then
6+
sed "s/%%FOOTER_VERSION%%/${GITHUB_REF_NAME}/" meta.tmpl.tex > meta.tex
7+
else
8+
sed "s/%%FOOTER_VERSION%%/UNDEFINED VERSION/" meta.tmpl.tex > meta.tex
9+
fi
10+
511
docker run --rm -v `pwd`:/data uppalabharath/pandoc-latex-cjk:latest --from=gfm+rebase_relative_paths -o learn-go-with-tests.pdf \
612
-H meta.tex --pdf-engine=xelatex --variable urlcolor=blue --toc --toc-depth=1 \
713
-B pdf-cover.tex \

meta.tex renamed to meta.tmpl.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
\pagestyle{fancy}
1313
\fancyhf{}
14-
\cfoot{v 10.0.0}
14+
\cfoot{%%FOOTER_VERSION%%}

0 commit comments

Comments
 (0)