From 5b89315bcc92bf52474707187fe7c5e789f3560a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 22 May 2025 13:57:46 -0400 Subject: [PATCH] manual: Add cover PDF build to CI This is not invoked as part of the normal build process, and shouldn't be: we only ever want to build the cover PDFs when we're uploading them for printing, and don't want everyone who wants to build Freedoom to have to install Inkscape. However, we should nonetheless include it in the CI to check that the build step works. --- .github/workflows/make.yml | 7 ++++++- manual/Makefile | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 7f2987b6..fdca31f6 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -18,7 +18,8 @@ jobs: - name: Install Prerequisites run: | sudo apt update - sudo apt install python3-pil asciidoc unzip zip ruby dos2unix + sudo apt install python3-pil asciidoc unzip zip ruby dos2unix \ + inkscape sudo gem install asciidoctor-pdf --pre - name: Install Deutex run: | @@ -43,6 +44,10 @@ jobs: export VERSION=${VERSION:1} fi echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + - name: Make manual cover PDFs + run: | + cd manual + make covers - name: Upload Freedoom uses: actions/upload-artifact@v4 with: diff --git a/manual/Makefile b/manual/Makefile index f840145f..b8e6eab0 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -11,9 +11,16 @@ ASCIIDOCTOR_FLAGS = -a pdf-page-size=A5 MANUAL_ADOC_FILES=$(wildcard freedoom-manual-??.adoc) MANUAL_PDF_FILES=$(subst .adoc,.pdf,$(MANUAL_ADOC_FILES)) +COVER_PDF_FILES=cover.pdf all: $(MANUAL_PDF_FILES) +# We only build the cover PDFs if the user explicitly runs `make covers`; +# this is because it requires Inkscape and we don't want it as a build +# dependency. Most users won't ever need these, we only use them when we're +# uploading the PDF files to print physical manuals. +covers: $(COVER_PDF_FILES) + freedoom-manual-%.pdf: freedoom-manual-%.adoc -asciidoctor-pdf $(ASCIIDOCTOR_FLAGS) $< -o $@ @@ -21,4 +28,4 @@ cover.pdf: cover/cover.svg cover/serpentipede.png cover/minigunner.png inkscape -o $@ $< clean: - $(RM) $(MANUAL_PDF_FILES) + $(RM) $(MANUAL_PDF_FILES) $(COVER_PDF_FILES)