Files
RP2040-Decoder/.github/workflows/render-pcbdraw.yml
T

57 lines
1.6 KiB
YAML

name: Render KiCad PCB with pcbdraw
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
render-pcbdraw:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install KiCad 8.0.6 and Dependencies
env:
DISPLAY: :99 # Set DISPLAY for Xvfb
run: |
# Install Xvfb for virtual display
sudo apt-get update
sudo apt-get install -y xvfb
# Start Xvfb
Xvfb :99 -screen 0 1024x768x16 &
# Add KiCad PPA and install KiCad
sudo add-apt-repository --yes ppa:kicad/kicad-8.0-releases
sudo apt-get update
sudo apt-get install -y kicad=8.0.6-0* kicad-footprints kicad-packages3d kicad-symbols python3-wxgtk4.0 python3-pip
# Install pcbdraw
pip install pcbdraw
- name: Render PCB Image
env:
PYTHONPATH: /usr/lib/kicad/lib/python3/dist-packages
DISPLAY: :99 # Use the same Xvfb display
run: |
Xvfb :99 -screen 0 1024x768x16 & # Ensure Xvfb is running
mkdir -p docs/images
pcbdraw render KiCad/RP2040-Decoder.kicad_pcb docs/images/pcb_render.png
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and Push Rendered Image
run: |
git add docs/images/pcb_render.png
git commit -m "Update PCB render image"
git push origin dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}