Skip to content

Update generate-kit-pdf.yaml #2

Update generate-kit-pdf.yaml

Update generate-kit-pdf.yaml #2

#########################################################################################
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
#########################################################################################
name: Generate Kit Template PDF
on:
push:
paths:
- 'docs-kits/kit-template/**'
- 'scripts/generate_kit_pdf.py'
- '.github/workflows/generate-kit-pdf.yaml'
pull_request:
paths:
- 'docs-kits/kit-template/**'
- 'scripts/generate_kit_pdf.py'
- '.github/workflows/generate-kit-pdf.yaml'
workflow_dispatch:
jobs:
generate-pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install markdown weasyprint
- name: Generate PDF
run: |
python scripts/generate_kit_pdf.py
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: kit-template-pdf
path: kit-template.pdf
retention-days: 30
- name: Check PDF file
run: |
if [ -f kit-template.pdf ]; then
echo "PDF generated successfully!"
ls -lh kit-template.pdf
else
echo "Error: PDF file not found!"
exit 1
fi