Skip to content

Commit 112027d

Browse files
committed
Run GHA.
Copied from Neotron Pico.
1 parent 64fcb5d commit 112027d

File tree

3 files changed

+310
-21
lines changed

3 files changed

+310
-21
lines changed

.github/workflows/kicad-release.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@ jobs:
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v2
15-
- name: Set version number # Replace [Uncontrolled] with actual tag
15+
with:
16+
submodules: recursive
17+
- name: Get Branch Name
18+
id: branch_name
19+
run: |
20+
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
21+
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
22+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
23+
- name: Set version number
1624
env:
17-
GITHUB_REF: ${{ github.ref }}
25+
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
1826
run: |
19-
sed -i "s~\[Uncontrolled\]~${GITHUB_REF/#refs\/tags\/}~g" Kicad/*.sch Kicad/*.kicad_pcb
20-
- name: Build project # This would actually build your project, using zip for an example artifact
21-
uses: nerdyscout/kicad-exports@v2.2
27+
sed -i "s~\[Uncontrolled\]~${SOURCE_TAG}~g" Kicad/*.sch Kicad/*.kicad_pcb
28+
- name: Build project
29+
uses: nerdyscout/kicad-exports@v2.3
2230
with:
23-
config: 'Kicad/docs.yml'
31+
config: 'Kicad/docs.kibot.yaml'
2432
dir: docs
2533
schema: 'Kicad/Neotron-Common-Hardware.sch'
2634
board: 'Kicad/Neotron-Common-Hardware.kicad_pcb'
@@ -31,19 +39,19 @@ jobs:
3139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3240
with:
3341
tag_name: ${{ github.ref }}
34-
release_name: Release ${{ github.ref }}
42+
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
3543
draft: false
3644
prerelease: false
37-
- name: Build zip file
45+
- name: Build gerbers zip file
46+
env:
47+
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
3848
run: |
39-
zip -r --junk-paths neotron-common-hardware-release.zip docs/
40-
- name: Upload Release
41-
id: upload-release-asset
42-
uses: actions/upload-release-asset@v1
49+
zip -r --junk-paths neotron-common-hardware-gerbers-${SOURCE_TAG}.zip docs/gerbers/
50+
- name: Upload files to Release
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
files: |
54+
neotron-common-hardware-gerbers-*.zip
55+
docs/*
4356
env:
4457
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
with:
46-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
47-
asset_path: ./neotron-common-hardware-release.zip
48-
asset_name: neotron-common-hardware-release.zip
49-
asset_content_type: application/zip

.github/workflows/kicad.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@ jobs:
1818
Kicad:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v2
22-
- uses: nerdyscout/kicad-exports@v2.2
21+
- name: Checkout
22+
uses: actions/checkout@v2
2323
with:
24-
config: 'Kicad/docs.yml'
24+
submodules: recursive
25+
- name: Set version number
26+
env:
27+
GITHUB_SHA: ${{ github.sha }}
28+
run: |
29+
sed -i "s~\[Uncontrolled\]~${GITHUB_SHA:0:6}~g" Kicad/*.sch Kicad/*.kicad_pcb
30+
- name: Run KiBot
31+
uses: nerdyscout/[email protected]
32+
with:
33+
config: 'Kicad/docs.kibot.yaml'
2534
dir: docs
2635
schema: 'Kicad/Neotron-Common-Hardware.sch'
2736
board: 'Kicad/Neotron-Common-Hardware.kicad_pcb'
28-
- name: upload results
37+
- name: Upload Results
2938
uses: actions/upload-artifact@v2
3039
with:
3140
name: docs

Kicad/docs.kibot.yaml

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
kibot:
2+
version: 1
3+
4+
filters:
5+
- name: fix_rotation
6+
comment: 'Adjust rotation for JLC'
7+
type: rot_footprint
8+
rotations:
9+
- ["^SO-20", 270.0]
10+
11+
- name: only_jlc_parts
12+
comment: 'Only parts with JLC code'
13+
type: generic
14+
include_only:
15+
- column: 'LCSC Part#'
16+
regex: '^C\d+'
17+
18+
- name: only_fitted_parts
19+
comment: 'Only parts that are not DNF'
20+
type: generic
21+
include_only:
22+
- column: 'DNP'
23+
regex: '^0'
24+
25+
variants:
26+
- name: rotated
27+
comment: 'Just a place holder for the rotation filter'
28+
type: kibom
29+
variant: rotated
30+
pre_transform: fix_rotation
31+
32+
preflight:
33+
run_erc: true
34+
run_drc: true
35+
check_zone_fills: true
36+
ignore_unconnected: false
37+
update_xml: true
38+
39+
outputs:
40+
# For more information: https://github.com/INTI-CMNB/KiBoM
41+
- name: 'generic_sch_pdf'
42+
comment: "Print the schematic as a PDF"
43+
type: pdf_sch_print
44+
options:
45+
output: '%f-schematic-%r.%x'
46+
47+
- name: 'make_gerbers'
48+
comment: "Generate gerber files"
49+
type: gerber
50+
layers:
51+
- F.Cu
52+
- In1.Cu
53+
- In2.Cu
54+
- B.Cu
55+
- Edge.Cuts
56+
- F.SilkS
57+
- F.Paste
58+
- F.Mask
59+
- B.SilkS
60+
- B.Paste
61+
- B.Mask
62+
dir: gerbers
63+
options:
64+
# generic layer options
65+
exclude_edge_layer: false
66+
exclude_pads_from_silkscreen: false
67+
plot_sheet_reference: false
68+
plot_footprint_refs: true
69+
plot_footprint_values: true
70+
force_plot_invisible_refs_vals: false
71+
tent_vias: true
72+
line_width: 0.15
73+
74+
# gerber options
75+
use_aux_axis_as_origin: false
76+
subtract_mask_from_silk: true
77+
use_protel_extensions: false
78+
gerber_precision: 4.5
79+
create_gerber_job_file: true
80+
use_gerber_x2_attributes: true
81+
use_gerber_net_attributes: false
82+
83+
- name: 'make_drills'
84+
comment: "Generate drill files"
85+
type: excellon
86+
dir: gerbers
87+
88+
- name: 'make_ascii_position'
89+
comment: "Generate XY position files in ASCII"
90+
type: position
91+
dir: gerbers
92+
93+
- name: 'make_dxf'
94+
comment: "Generate 2D PCB CAD in DXF format"
95+
type: dxf
96+
layers:
97+
- F.Cu
98+
- In1.Cu
99+
- In2.Cu
100+
- B.Cu
101+
- Edge.Cuts
102+
- F.SilkS
103+
- F.Paste
104+
- F.Mask
105+
- B.SilkS
106+
- B.Paste
107+
- B.Mask
108+
options:
109+
output: '%f-pcb-cad-%r.%x'
110+
exclude_edge_layer: false
111+
metric_units: true
112+
113+
- name: 'make_svg'
114+
comment: "Generate 2D PCB image in SVG format"
115+
type: pcbdraw
116+
options:
117+
output: '%f-pcb-%r.%x'
118+
119+
- name: 'make_png'
120+
comment: "Generate 2D PCB image in PNG format"
121+
type: pcbdraw
122+
options:
123+
output: '%f-pcb-%r.%x'
124+
format: png
125+
126+
- name: 'make_step'
127+
comment: "Generate 3D PCB model in STEP format"
128+
type: step
129+
options:
130+
output: '%f-3d-%r.%x'
131+
132+
- name: 'make_pcb_pdf'
133+
comment: "Generate 2D PCB CAD in PDF format"
134+
type: pdf_pcb_print
135+
layers:
136+
- F.Cu
137+
- In1.Cu
138+
- In2.Cu
139+
- B.Cu
140+
- Edge.Cuts
141+
- F.SilkS
142+
- F.Paste
143+
- F.Mask
144+
- B.SilkS
145+
- B.Paste
146+
- B.Mask
147+
options:
148+
output: '%f-pcb-%r.%x'
149+
separated: true
150+
monochrome: true
151+
152+
- name: 'make_bom_csv'
153+
comment: "Generate bill-of-material file as CSV"
154+
type: bom
155+
options:
156+
exclude_filter: 'only_fitted_parts'
157+
group_fields:
158+
- 'Part'
159+
- 'Part Lib'
160+
- 'Value'
161+
- 'Voltage'
162+
- 'Tolerance'
163+
- 'Footprint'
164+
- 'Footprint Lib'
165+
columns:
166+
- field: Manufacturer
167+
name: Part Number
168+
join: ['mpn']
169+
- Footprint
170+
- References
171+
- Quantity per PCB
172+
- field: Value
173+
join: ['voltage', 'current', 'power', 'tolerance']
174+
- Footprint
175+
- field: 'LCSC Part#'
176+
name: LCSC
177+
- Digikey
178+
- Mouser
179+
output: '%f-bom-%r.%x'
180+
181+
- name: 'make_bom_html'
182+
comment: "Generate bill-of-material files as HTML"
183+
type: bom
184+
options:
185+
format: HTML
186+
exclude_filter: 'only_fitted_parts'
187+
html:
188+
datasheet_as_link: "Datasheet"
189+
digikey_link: "Digikey"
190+
title: "Neotron Pico Bill of Materials"
191+
group_fields:
192+
- 'Part'
193+
- 'Part Lib'
194+
- 'Value'
195+
- 'Voltage'
196+
- 'Tolerance'
197+
- 'Footprint'
198+
- 'Footprint Lib'
199+
columns:
200+
- Row
201+
- field: Manufacturer
202+
name: Part Number
203+
join: ['mpn']
204+
- References
205+
- Quantity per PCB
206+
- field: Value
207+
join: ['voltage', 'current', 'power', 'tolerance']
208+
- field: 'LCSC Part#'
209+
name: LCSC
210+
- Digikey
211+
- Mouser
212+
- Footprint
213+
output: '%f-bom-%r.%x'
214+
215+
- name: 'make_ibom'
216+
comment: "Generate assembly HTML page"
217+
type: ibom
218+
options:
219+
output: '%f-ibom-%r.%x'
220+
extra_fields: "Voltage,Tolerance,Manufacturer,MPN"
221+
222+
- name: 'make_jlc_position'
223+
comment: "Generate pick and place file, JLC style"
224+
type: position
225+
options:
226+
variant: rotated
227+
output: '%f-cpl-jlc-%r.%x'
228+
format: CSV
229+
units: millimeters
230+
separate_files_for_front_and_back: false
231+
only_smd: true
232+
columns:
233+
- id: Ref
234+
name: Designator
235+
- Val
236+
- Package
237+
- id: PosX
238+
name: "Mid X"
239+
- id: PosY
240+
name: "Mid Y"
241+
- id: Rot
242+
name: Rotation
243+
- id: Side
244+
name: Layer
245+
246+
- name: 'make_jlc_bom'
247+
comment: "Generate BoM, JLC style"
248+
type: bom
249+
options:
250+
group_fields:
251+
- 'Part'
252+
- 'Part Lib'
253+
- 'Value'
254+
- 'Voltage'
255+
- 'Tolerance'
256+
- 'Footprint'
257+
- 'Footprint Lib'
258+
output: '%f-bom-jlc-%r.%x'
259+
exclude_filter: 'only_jlc_parts'
260+
ref_separator: ','
261+
columns:
262+
- field: Value
263+
name: Comment
264+
- field: References
265+
name: Designator
266+
- Footprint
267+
- field: 'LCSC Part#'
268+
name: 'LCSC Part #'
269+
csv:
270+
hide_pcb_info: true
271+
hide_stats_info: true
272+
quote_all: true

0 commit comments

Comments
 (0)