Skip to content

Commit 9a565b8

Browse files
committed
Initial commit
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
0 parents  commit 9a565b8

33 files changed

Lines changed: 132673 additions & 0 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: ERC/DRC Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
erc-drc-checks:
11+
runs-on: ubuntu-24.04
12+
container:
13+
image: kicad/kicad:10.0
14+
options: --user root
15+
strategy:
16+
matrix:
17+
project: [pblprog-sifli-board, pblprog-sifli-flex]
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Create output directory
23+
run: |
24+
mkdir output
25+
26+
- name: Schematic ERC
27+
run: |
28+
kicad-cli sch erc \
29+
-o erc.rpt \
30+
--severity-error \
31+
--exit-code-violations \
32+
${{ matrix.project }}/${{ matrix.project }}.kicad_sch
33+
34+
- name: Board DRC
35+
run: |
36+
kicad-cli pcb drc \
37+
-o drc.rpt \
38+
--exit-code-violations \
39+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
40+
41+
- name: Archive
42+
uses: actions/upload-artifact@v7
43+
if: always()
44+
with:
45+
name: ${{ matrix.project }}-reports
46+
path: '**/*.rpt'
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Generate Production Files
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
pull_request:
10+
11+
env:
12+
IBOM_VERSION: 2.11.2
13+
KIKIT_VERSION: 1.8.0
14+
15+
jobs:
16+
generate-prod-files:
17+
runs-on: ubuntu-24.04
18+
container:
19+
image: kicad/kicad:10.0
20+
options: --user root
21+
strategy:
22+
matrix:
23+
project: [pblprog-sifli-board, pblprog-sifli-flex]
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
28+
- name: Create output directory
29+
run: |
30+
mkdir output
31+
32+
- name: Export schematic to PDF
33+
run: |
34+
kicad-cli sch export pdf -n -o output/schematic.pdf ${{ matrix.project }}/${{ matrix.project }}.kicad_sch
35+
36+
- name: Export PCB drawings to PDF
37+
run: |
38+
kicad-cli pcb export pdf \
39+
--layers "F.Cu,F.Silkscreen" \
40+
--output output/front.pdf \
41+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
42+
43+
kicad-cli pcb export pdf \
44+
--layers "B.Cu,B.Silkscreen" \
45+
--output output/back.pdf \
46+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
47+
48+
kicad-cli pcb export pdf \
49+
--layers "F.Fab,Edge.Cuts,User.1" \
50+
--output output/fab.pdf \
51+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
52+
53+
- name: Install InteractiveHtmlBom
54+
run: |
55+
git clone --depth 1 --branch v${IBOM_VERSION} https://github.com/openscopeproject/InteractiveHtmlBom
56+
57+
- name: Generate InteractiveHtmlBom
58+
env:
59+
INTERACTIVE_HTML_BOM_NO_DISPLAY: 1
60+
run: |
61+
# --dest-dir is relative to the board file's directory, so use an
62+
# absolute path to land in the archived output/ at the repo root.
63+
python3 InteractiveHtmlBom/InteractiveHtmlBom/generate_interactive_bom.py \
64+
--dest-dir "${GITHUB_WORKSPACE}/output" \
65+
--name-format ibom \
66+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
67+
68+
- name: Install KiKit
69+
run: |
70+
apt-get update && apt-get install -y python3-pip zip
71+
pip install --break-system-packages kikit==${KIKIT_VERSION}
72+
73+
- name: Generate JLCPCB files
74+
run: |
75+
kikit fab jlcpcb \
76+
--assembly \
77+
--schematic ${{ matrix.project }}/${{ matrix.project }}.kicad_sch \
78+
--field "LCSC" \
79+
--correctionpatterns lib/jlcpcb-kikit-corrections.csv \
80+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb \
81+
output/jlcpcb
82+
83+
- name: Add stiffener (User.2) layer to JLCPCB gerbers
84+
if: matrix.project == 'pblprog-sifli-flex'
85+
run: |
86+
staging="$(mktemp -d)"
87+
88+
kicad-cli pcb export gerbers \
89+
--layers User.2 \
90+
--output "${staging}/gerber/" \
91+
${{ matrix.project }}/${{ matrix.project }}.kicad_pcb
92+
93+
# Keep only the layer gerber; drop the stray job file.
94+
rm -f "${staging}/gerber/"*.gbrjob
95+
mv "${staging}/gerber/"*-User_2.gbr \
96+
"${staging}/gerber/${{ matrix.project }}-Stiffener.gbr"
97+
98+
# Fold the layer into KiKit's gerbers.zip (under its "gerber/" prefix).
99+
(cd "${staging}" && zip -r "${GITHUB_WORKSPACE}/output/jlcpcb/gerbers.zip" gerber)
100+
101+
- name: Archive
102+
uses: actions/upload-artifact@v7
103+
with:
104+
name: ${{ matrix.project }}-output
105+
path: output
106+
107+
release:
108+
needs: generate-prod-files
109+
if: startsWith(github.ref, 'refs/tags/')
110+
runs-on: ubuntu-24.04
111+
permissions:
112+
contents: write
113+
steps:
114+
- name: Download production files
115+
uses: actions/download-artifact@v7
116+
with:
117+
path: artifacts
118+
119+
- name: Package production files
120+
run: |
121+
cd artifacts
122+
for dir in *-output; do
123+
project="${dir%-output}"
124+
(cd "$dir" && zip -r "../${project}-${TAG}.zip" .)
125+
done
126+
env:
127+
TAG: ${{ github.ref_name }}
128+
129+
- name: Create GitHub release
130+
uses: softprops/action-gh-release@v2
131+
with:
132+
files: artifacts/*.zip

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
\#*
2+
fp-info-cache
3+
*-backups/
4+
*.bak
5+
_autosave*
6+
*.lck
7+
output/
8+
*.rpt
9+
.history/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Pebble Programmer for SiFli boards
2+
3+
This repository contains the design files for `pblprog-sifli`, the Pebble
4+
Programmer for SiFli boards.
5+
6+
<p align="center">
7+
<img width="400" src="pblprog-sifli-board/pblprog-sifli-board.png">
8+
<img width="400" src="pblprog-sifli-flex/pblprog-sifli-flex.png">
9+
</p>

lib/jlcpcb-kikit-corrections.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
".*Footprint pattern","Part ID pattern","X Correction","Y Correction","Rotation"
2+
".*DFN-","","0","0","270"
3+
".*QFN-","","0","0","270"
4+
".*SO-","","0","0","270"
5+
".*SOT-","","0","0","270"

0 commit comments

Comments
 (0)