Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build book in CI #15

Merged
merged 6 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/lilypond.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
env:
MAKEFLAGS: --jobs=4
LILYPOND_VERSION: 2.24.1
# TODO Update TECTONIC_VERSION to 0.15.0 once OpenSSL 3.0 is in the Docker
# image:
TECTONIC_VERSION: 0.14.1
VARIANTS_PDF: eogsized
jobs:
build:
Expand All @@ -24,6 +27,11 @@ jobs:
file: docker/Dockerfile
build-args: LILYPOND_VERSION=${{ env.LILYPOND_VERSION }}
tags: my-lilydock:${{ env.LILYPOND_VERSION }}
- uses: wtfjoke/setup-tectonic@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tectonic-version: ${{ env.TECTONIC_VERSION }}
- run: cp -f "$(command -v tectonic)" "${{ github.workspace }}/tectonic"
- name: Build PDFs
uses: addnab/docker-run-action@v3
with:
Expand All @@ -33,8 +41,12 @@ jobs:
--env MAKEFLAGS
--env VARIANTS_PDF
image: my-lilydock:${{ env.LILYPOND_VERSION }}
run: make --environment-overrides pdf
run: |
git config --global --add safe.directory '*' &&
make --environment-overrides booklayout/toplevel.pdf SKIP_SPELLCHECK=1 TECTONIC=${{ github.workspace }}/tectonic
- uses: actions/upload-artifact@v4
with:
name: pdfs
path: PDF/*/*.pdf
path: |
PDF/*/*.pdf
booklayout/toplevel.pdf
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TOTAL_FILE_COUNT = 387
TOTAL_PAGE_COUNT = 358 # for toplevel

LILYPOND ?= lilypond
TECTONIC ?= tectonic

space :=#
space +=#
Expand Down Expand Up @@ -205,7 +206,7 @@ check_book: book
CLOBBERFILES += metrics/
metrics/%.metrics: PDF/eogsized/%.pdf | metrics
@echo "[ METRICS ] $@"
magick identify -format "%P %@\n" $< > $@
identify -format "%P %@\n" $< > $@

CLOBBERFILES += booklayout/book.tex booklayout/book.aux booklayout/book.log
booklayout/book.tex: $(LYS:%.ly=metrics/%.metrics) | $(LYS:%.ly=PDF/eogsized/%.pdf)
Expand All @@ -218,7 +219,7 @@ booklayout/index.meter: $(LYS:%.ly=PDF/eogsized/%.meter)

%.pdf: %.tex
@echo "[ LATEX ] $@"
tectonic -Zsearch-path=$(CURDIR) $<
$(TECTONIC) -Zsearch-path=$(CURDIR) $<

.PHONY: FORCE
booklayout/revision.tex: FORCE
Expand Down
16 changes: 16 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,19 @@ RUN \
qpdf

RUN apt install -y make

# Install dependencies for book build:
RUN apt install \
git \
imagemagick \
libarray-group-perl \
libfile-slurp-perl \
liblingua-stem-perl \
libperl6-slurp-perl \
libregexp-common-perl \
libtext-trim-perl \
-y # end of list

# Disable a security workaround for Ghostscript:
# (see https://stackoverflow.com/a/59193253)
RUN sed -i '/PDF/{/rights=.*none/d}' /etc/ImageMagick*/policy.xml
2 changes: 2 additions & 0 deletions transforms.map
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,5 @@ what -- e’er whate’er
wher -- e’er where’er
won -- d’ring wondering
wor -- ship -- pers worshippers
Can't locate Array/Group.pm in @INC (you may need to install the Array::Group module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/aarch64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at scripts/getlyrics.pl line 7.
BEGIN failed--compilation aborted at scripts/getlyrics.pl line 7.