From 1887d781c155195ad629fcf55a1fe9b49608b118 Mon Sep 17 00:00:00 2001 From: Boyd Duffee Date: Tue, 21 Apr 2026 21:36:00 +0100 Subject: [PATCH] Adding github workflow to generate pdf only trigger when files under PDL change --- .github/workflows/generate_pdf.yml | 44 ++++++++++++++++++++++++++++++ cpanfile | 16 +++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/generate_pdf.yml create mode 100644 cpanfile diff --git a/.github/workflows/generate_pdf.yml b/.github/workflows/generate_pdf.yml new file mode 100644 index 0000000..7fc0e5a --- /dev/null +++ b/.github/workflows/generate_pdf.yml @@ -0,0 +1,44 @@ +name: generate-pdf + +on: + push: + branches: [ "master" ] + paths: + - 'PDL/**' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + # ubuntu-slim only uses 1 CPU and 5GB RAM, ubuntu-latest has 4 CPUs and 16GB RAM + runs-on: ubuntu-slim + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + - name: Setup Perl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: "5.28" + # install-modules-with: cpanm # installs your cpanfile + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y texlive-extra-utils + cpanm --sudo -v --installdeps --notest --cpanfile cpanfile . + + - name: Write POD as PDF and jam them together + run: | + ./make_chapters.pl + ./make_endpieces.pl + pdfjam -o PDL_Book.pdf FrontPage.pdf toc.pdf Chapter??.pdf + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: PDL-Book + path: PDL_Book.pdf + retention-days: 3 diff --git a/cpanfile b/cpanfile new file mode 100644 index 0000000..cf04842 --- /dev/null +++ b/cpanfile @@ -0,0 +1,16 @@ +requires 'perl' => '5.006'; + +requires 'App::pod2pdf'; +requires 'File::Type'; +requires 'Getopt::Long'; +requires 'Image::Size'; +requires 'PDF::API2'; +requires 'Pod::Checker'; +requires 'Pod::Parser'; +requires 'Pod::Usage'; + +on 'develop' => sub { + requires 'perl' => '5.020'; + + requires 'File::Find'; # for the pre-commit hook +};