Skip to content

Add CI for PDF generation#90

Open
rcalixte wants to merge 1 commit into
0xAX:masterfrom
rcalixte:mk_pdf
Open

Add CI for PDF generation#90
rcalixte wants to merge 1 commit into
0xAX:masterfrom
rcalixte:mk_pdf

Conversation

@rcalixte

@rcalixte rcalixte commented Jul 6, 2026

Copy link
Copy Markdown

Description

Add CI to automatically generate PDFs on pushes to master with a manual trigger for creation as well.

A CI job sample run is here the forked repository contains a release asset with the PDF as well.

Changes proposed in this pull request:

Content modifications are to support PDF generation:

  • SVGs were converted to PNGs
  • One newline inserted

Related issues

@rcalixte rcalixte requested review from 0xAX and klaudiagrz as code owners July 6, 2026 19:57
@0xAX

0xAX commented Jul 6, 2026

Copy link
Copy Markdown
Owner

@rcalixte thank you very much! I will take a look tomorrow morning

@0xAX

0xAX commented Jul 7, 2026

Copy link
Copy Markdown
Owner

@rcalixte I tested it and it looks really great! Thank you a lot. I have just two little suggestions that I'll describe in the next comments.

with:
entrypoint: './pandoc-docker.sh'

- id: short_sha

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not generate it at each possible commit/PR. I think the best way will be to build PDF by tags (I will push one right after we will merge the PR) but also leave sha-based builds but only for manual builds (based on workflow_dispatch).

Something like this (I did not test it although by myself yet):

---
name: Generate PDF using Pandoc

on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  create_pdf:
    runs-on: ubuntu-latest

    permissions:
      contents: write

    container:
      image: pandoc/latex:3

    steps:
      - uses: actions/checkout@v7

      - uses: docker://pandoc/latex:3
        timeout-minutes: 10
        with:
          entrypoint: './pandoc-docker.sh'

      - id: release_meta
        shell: bash
        run: |
          short_sha="${GITHUB_SHA::7}"

          if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
            echo "tag_name=dev-${short_sha}" >> "$GITHUB_OUTPUT"
            echo "prerelease=true" >> "$GITHUB_OUTPUT"
            echo "make_latest=false" >> "$GITHUB_OUTPUT"
          else
            echo "tag_name=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
            echo "prerelease=false" >> "$GITHUB_OUTPUT"
            echo "make_latest=true" >> "$GITHUB_OUTPUT"
          fi

      - uses: softprops/action-gh-release@v3
        with:
          tag_name: ${{ steps.release_meta.outputs.tag_name }}
          target_commitish: ${{ github.sha }}
          draft: false
          prerelease: ${{ steps.release_meta.outputs.prerelease }}
          make_latest: ${{ steps.release_meta.outputs.make_latest }}
          fail_on_unmatched_files: true
          files: |
            *.pdf

@rcalixte what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean and I can work to implement this.

Comment thread include.tex

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this and all related scripts below, pandoc configuration and so on to ./scripts/pdf directory or something like this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to move things around. I'll include this in the update as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants