Skip to content

Add automatic release workflow with Marp-to-HTML and Markdown-to-PDF conversion#1

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-automatic-releases
Open

Add automatic release workflow with Marp-to-HTML and Markdown-to-PDF conversion#1
Copilot wants to merge 3 commits intomainfrom
copilot/add-automatic-releases

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 11, 2026

Adds a GitHub Actions release workflow that automatically converts workshop markdown files and publishes them as GitHub release assets when a version tag is pushed.

Description

Workshop materials (slides and docs) have no automated distribution mechanism. This adds a release.yml workflow that converts files based on type — Marp presentations to HTML, all other markdown to PDF — and attaches them to a GitHub release.

Detection logic:

  • Files with marp: true front matter (matched via ^\s*marp:\s*true) → converted to HTML via @marp-team/marp-cli
  • All other .md files → converted to PDF via pandoc + xelatex

Output naming preserves directory structure encoded as hyphens:

  • part-1/slides.mdpart-1-slides.html
  • part-1/03-pods/lab/instructions.mdpart-1-03-pods-lab-instructions.pdf

Release creation uses gh release create with --generate-notes for automatic changelog from commits.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update
  • Presentation/slides update
  • Infrastructure/setup improvement
  • Test/validation improvement
  • Workshop content enhancement

Related Issue

Changes Made

  • Added .github/workflows/release.yml triggered on v*.*.* tag pushes
  • Installs @marp-team/marp-cli (Node 20) and pandoc + texlive-xetex + fonts-dejavu
  • Converts slides.md files (Marp) to self-contained HTML
  • Converts all other .md files (excluding .github/ and node_modules/) to PDF using GFM input + xelatex
  • Guards release creation against empty dist/; individual PDF failures are non-fatal warnings

Workshop Section Affected

  • Part 1 - Section(s): ___________
  • Part 2 - Section(s): ___________
  • Setup/Infrastructure
  • Documentation
  • Presentation slides
  • Resources/Cheatsheets
  • Other: ___________

Testing Done

  • Tested on Podman
  • Tested on Docker
  • Tested in Dev Container
  • Tested on Windows
  • Tested on macOS
  • Tested on Linux
  • Validated YAML syntax (make validate)
  • Ran workshop tests (make test)
  • Verified presentation slides render correctly
  • Completed lab exercises with these changes

Test Results:

# File detection logic validated locally:
# Marp files detected: part-1/slides.md, part-2/slides.md
# Regular markdown files: 60+ files correctly routed to PDF conversion

Documentation

  • Updated relevant README files
  • Updated PREREQUISITES.md (if setup changed)
  • Updated CONTRIBUTING.md (if needed)
  • Updated CHANGELOG.md
  • Added/updated code comments
  • Updated presentation slides (if needed)
  • No documentation needed

Screenshots/Examples

# Trigger
on:
  push:
    tags:
      - 'v*.*.*'

# Marp → HTML
marp "$file" --html --output "dist/${dir}-slides.html"

# Markdown → PDF
pandoc "$file" --from=gfm --pdf-engine=xelatex \
  -V geometry:margin=1in -V mainfont="DejaVu Sans" \
  -o "$output"

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my changes
  • I have tested my changes thoroughly
  • My changes generate no new warnings or errors
  • I have updated documentation as needed
  • My changes maintain workshop flow and pedagogy
  • YAML files are properly formatted and validated
  • Shell scripts use LF line endings
  • PowerShell scripts use CRLF line endings
  • I have read the CONTRIBUTING.md guidelines

Additional Context

Requires no repository secrets beyond the default GITHUB_TOKEN. The workflow uses permissions: contents: write scoped to the release job only.

For Maintainers

  • Code review completed
  • CI/CD checks passed
  • Workshop flow validated
  • Educational quality maintained
  • Ready to merge
Original prompt

I would like to have automatic releases. The releases should contain the converted md files, depending on the type either as html (for marp) or as pdf for "normal" md files.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…conversion

Co-authored-by: rfaes <2385561+rfaes@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automatic release generation for converted files Add automatic release workflow with Marp-to-HTML and Markdown-to-PDF conversion Mar 11, 2026
@rfaes rfaes marked this pull request as ready for review March 11, 2026 22:05
@rfaes rfaes requested a review from Copilot March 11, 2026 22:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to automate GitHub Releases for workshop materials by converting markdown sources into publishable artifacts (Marp → HTML, other Markdown → PDF) and uploading them as release assets on version tag pushes.

Changes:

  • Introduces .github/workflows/release.yml triggered by v*.*.* tag pushes.
  • Installs Marp CLI + Pandoc/TeX tooling and generates HTML/PDF artifacts into dist/.
  • Creates a GitHub Release via gh release create and attaches the generated artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment on lines +37 to +41
find . -name "slides.md" -type f | while read file; do
dir=$(dirname "$file" | sed 's|^\./||' | tr '/' '-')
output="dist/${dir}-slides.html"
echo "Converting $file -> $output"
marp "$file" --html --output "$output"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The Marp→HTML step only targets files named slides.md. Any markdown file with marp: true but a different filename would be skipped here and also skipped by the PDF step (because it filters on marp: true), resulting in missing release artifacts. Consider driving the HTML conversion off the same marp: true front-matter detection (or consolidating into a single loop that routes each .md file to Marp vs Pandoc).

Suggested change
find . -name "slides.md" -type f | while read file; do
dir=$(dirname "$file" | sed 's|^\./||' | tr '/' '-')
output="dist/${dir}-slides.html"
echo "Converting $file -> $output"
marp "$file" --html --output "$output"
find . -name "*.md" \
-not -path "./.github/*" \
-not -path "./node_modules/*" \
-type f | while read file; do
if head -5 "$file" | grep -qE '^\s*marp:\s*true'; then
name=$(echo "$file" | sed 's|^\./||' | tr '/' '-' | sed 's|\.md$||')
output="dist/${name}.html"
echo "Converting $file -> $output"
marp "$file" --html --output "$output"
fi

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml Outdated
Comment on lines +36 to +49
run: |
find . -name "slides.md" -type f | while read file; do
dir=$(dirname "$file" | sed 's|^\./||' | tr '/' '-')
output="dist/${dir}-slides.html"
echo "Converting $file -> $output"
marp "$file" --html --output "$output"
done

- name: Convert regular markdown files to PDF
run: |
find . -name "*.md" \
-not -path "./.github/*" \
-not -path "./node_modules/*" \
-type f | while read file; do
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Both conversion steps run find . ..., which will traverse the checked-out .git/ directory on the runner. That can add significant overhead and slow the workflow, especially when combined with per-file conversion. Prefer limiting the search to tracked markdown files (e.g., via git ls-files '*.md') or explicitly pruning .git (and dist) from the find traversal.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml Outdated
artifacts=$(find dist -type f | sort)
if [ -z "$artifacts" ]; then
echo "No artifacts found in dist/. Skipping release creation."
exit 1
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This guard prints "Skipping release creation" but exits with status 1, which fails the workflow run for the tag push. If the intent is to skip creating a release when dist/ is empty, exit 0 (or use gh release create ... || handling) so the workflow doesn’t report a failure for a no-op release.

Suggested change
exit 1
exit 0

Copilot uses AI. Check for mistakes.
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.

3 participants