Merge branch 'main' of https://github.com/allthingslinux/tuxkeychain #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate KiCad Images | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
images: | |
name: Generate Images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install KiCad 9.0 | |
run: | | |
sudo add-apt-repository --yes ppa:kicad/kicad-9.0-releases | |
sudo apt update | |
sudo apt install --install-recommends kicad poppler-utils | |
- name: Generate Images | |
run: | | |
rm images/* || true | |
kicad-cli pcb render --output=images/pcbf.png --side=top tuxkeychain.kicad_pcb | |
kicad-cli pcb render --output=images/pcbb.png --side=bottom tuxkeychain.kicad_pcb | |
kicad-cli sch export pdf --output=/tmp/schematic.pdf tuxkeychain.kicad_sch | |
# convert schematic to png with poppler | |
pdftoppm -png /tmp/schematic.pdf > images/schematic.png | |
- name: Commit and push images | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git add images/* | |
git commit -m "Add generated images" | |
git push |