Skip to content

Commit f1013ea

Browse files
committed
feat: add KiBot workflow and configuration for JLCPCB integration
1 parent a9ae91c commit f1013ea

2 files changed

Lines changed: 233 additions & 0 deletions

File tree

.github/workflows/kibot.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: KiBot
2+
3+
# Controls when the action will run.
4+
on:
5+
push:
6+
paths:
7+
- "board/output/pcbs/*.kicad_sch"
8+
- "board/output/pcbs/*.kicad_pcb"
9+
- "board/*.kibot.yaml"
10+
- ".github/workflows/kibot.yml"
11+
tags:
12+
- "v*.*.*"
13+
pull_request:
14+
paths:
15+
- "board/output/pcbs/*.kicad_sch"
16+
- "board/output/pcbs/*.kicad_pcb"
17+
- "board/*.kibot.yaml"
18+
- ".github/workflows/kibot.yml"
19+
repository_dispatch:
20+
types: [run_gha]
21+
22+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
23+
jobs:
24+
DRC:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: INTI-CMNB/KiBot@v2_dk9
29+
with:
30+
config: board/sessile.kibot.yaml
31+
dir: board/output/pcbs
32+
board: board/output/pcbs/sessile.kicad_pcb
33+
skip: erc
34+
targets: __NONE__
35+
36+
BOARD:
37+
runs-on: ubuntu-latest
38+
needs: [DRC]
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: INTI-CMNB/KiBot@v2_dk9
42+
with:
43+
config: board/sessile.kibot.yaml
44+
dir: board/output/pcbs
45+
board: board/output/pcbs/sessile.kicad_pcb
46+
variant: board
47+
skip: erc,drc
48+
targets: ZIP_ASSEMBLY
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: pcb
52+
path: board/output/pcbs/jlcpcb.zip
53+
54+
release:
55+
runs-on: ubuntu-latest
56+
if: startsWith(github.ref, 'refs/tags/')
57+
permissions:
58+
contents: write
59+
needs: BOARD
60+
steps:
61+
- uses: actions/download-artifact@v4
62+
with:
63+
name: pcb
64+
- name: Release
65+
uses: softprops/action-gh-release@v2
66+
with:
67+
files: "jlcpcb.zip"

board/sessile.kibot.yaml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Gerber and drill files for JLCPCB, without stencil
2+
# URL: https://jlcpcb.com/
3+
# Based on setting used by revxlp (https://gitlab.com/lpgalaxy/revxlp)
4+
5+
kibot:
6+
version: 1
7+
8+
preflight:
9+
erc: true
10+
drc:
11+
enabled: true
12+
ignore_unconnected: false
13+
fill_zones: true
14+
15+
# variants:
16+
# - name: board
17+
# comment: Main board
18+
# type: kibom
19+
# variant: board
20+
# pre_transform:
21+
# - fix_rotation
22+
23+
filters:
24+
- name: fix_rotation
25+
comment: Adjust rotation for JLC
26+
type: rot_footprint
27+
negative_bottom: false
28+
invert_bottom: true
29+
rotations:
30+
- ["^SOIC-16*", 270.0]
31+
- ["^SOT-23", 0.0]
32+
- ["^SW_SPDT_PCM12", 180.0]
33+
- ["^Panasonic_EVQPUL_.*", 90.0]
34+
- ["^D_.*", 180.0]
35+
- ["^R_.*", 180.0]
36+
37+
- name: only_jlc_parts
38+
comment: Only parts with JLC code
39+
type: generic
40+
include_only:
41+
- column: "LCSC"
42+
regex: '^C\d+'
43+
44+
outputs:
45+
# - name: SCHEMATIC
46+
# comment: Schematic in SVG format
47+
# type: svg_sch_print
48+
# options:
49+
# output: "%i.%x"
50+
51+
- name: JLCPCB_GERBERS
52+
comment: Gerbers compatible with JLCPCB
53+
type: gerber
54+
dir: JLCPCB
55+
options: &gerber_options
56+
output: "%f-%i%I.%x"
57+
exclude_edge_layer: true
58+
exclude_pads_from_silkscreen: true
59+
plot_sheet_reference: false
60+
plot_footprint_refs: true
61+
plot_footprint_values: false
62+
force_plot_invisible_refs_vals: false
63+
tent_vias: true
64+
use_protel_extensions: true
65+
create_gerber_job_file: false
66+
disable_aperture_macros: true
67+
gerber_precision: 4.6
68+
use_gerber_x2_attributes: false
69+
use_gerber_net_attributes: false
70+
line_width: 0.1
71+
subtract_mask_from_silk: true
72+
inner_extension_pattern: ".gp%n"
73+
layers:
74+
- F.Cu
75+
- B.Cu
76+
- F.SilkS
77+
- B.SilkS
78+
- F.Mask
79+
- B.Mask
80+
- F.Paste
81+
- B.Paste
82+
- Edge.Cuts
83+
84+
- name: JLCPCB_DRILL
85+
comment: Drill files compatible with JLCPCB
86+
type: excellon
87+
dir: JLCPCB
88+
options:
89+
pth_and_npth_single_file: false
90+
pth_id: "PTH"
91+
npth_id: "NPTH"
92+
metric_units: true
93+
map:
94+
type: gerber
95+
output: "%f-%i%I.%x"
96+
route_mode_for_oval_holes: false
97+
output: "%f-%i.%x"
98+
99+
- name: JLCPCB_POSITION
100+
comment: Pick and place position file compatible with JLCPCB
101+
type: position
102+
options:
103+
output: "%f_cpl_jlc.%x"
104+
format: CSV
105+
units: millimeters
106+
separate_files_for_front_and_back: false
107+
only_smd: false
108+
columns:
109+
- id: Ref
110+
name: Designator
111+
- Val
112+
- Package
113+
- id: PosX
114+
name: "Mid X"
115+
- id: PosY
116+
name: "Mid Y"
117+
- id: Rot
118+
name: Rotation
119+
- id: Side
120+
name: Layer
121+
122+
- name: JLCPCB_BOM
123+
comment: BoM for JLC
124+
type: bom
125+
options:
126+
output: "%f_%i_jlc.%x"
127+
exclude_filter: "only_jlc_parts"
128+
ref_separator: ","
129+
group_fields: ["Value", "Footprint", "LCSC"]
130+
columns:
131+
- field: Value
132+
name: Comment
133+
- field: References
134+
name: Designator
135+
- field: Footprint
136+
name: Footprint
137+
- field: "LCSC"
138+
name: "LCSC Part #"
139+
csv:
140+
hide_pcb_info: true
141+
hide_stats_info: true
142+
quote_all: true
143+
144+
- name: ZIP_FAB
145+
comment: ZIP file for JLCPCB
146+
type: compress
147+
options:
148+
files:
149+
- from_output: JLCPCB_GERBERS
150+
dest: /
151+
- from_output: JLCPCB_DRILL
152+
dest: /
153+
output: "JLCPCB/%f_jlc.zip"
154+
155+
- name: ZIP_ASSEMBLY
156+
comment: Gerbers, Drill, Position and BOM files for JLCPCB
157+
type: compress
158+
options:
159+
files:
160+
- from_output: ZIP_FAB
161+
dest: /
162+
- from_output: JLCPCB_POSITION
163+
dest: /
164+
- from_output: JLCPCB_BOM
165+
dest: /
166+
output: "jlcpcb.zip"

0 commit comments

Comments
 (0)