Skip to content

Commit f57a4e5

Browse files
Change CI to use JobSets instead of manually constructing all outputs with kicad-cli
add workflow dispatch to manually run jobs typo Workflow name clarity missing $ on env var Fix a few more typos fix filepaths typo for shield project name remove conditional check for merged documentation build typo missing $ another missing $ add ghostscript dependency, fix readme name and remove old renders Fix ghostscript file naming add reference path update BOM export script update bom formatter fix JobSet POS file format + python formatter kicad pos naming is driving me nuts UGHHH Try to fix ordering of committing and generating files Oops broke workflow broke it.. again Wrong git checkout flag Missing | Try to fix git / gh interop Fix pos file naming Remove git junk kicad is killing me Ugh Add upload materials back to repo Update READMEs
1 parent c5daa9d commit f57a4e5

18 files changed

+773
-401
lines changed

.github/workflows/ayab-esp32-design.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
name: Hardware Design
1+
name: AYAB ESP32 Hardware Check
22

33
on:
4+
workflow_dispatch:
5+
46
push:
57
branches:
68
- main
@@ -25,20 +27,16 @@ jobs:
2527
- name: Checkout code
2628
uses: actions/checkout@v4
2729

28-
- name: Create output directory
29-
run: mkdir -p ${workflow_project_dir}/outputs/gerbers
30-
3130
- name: Install KiCad
3231
run: sudo bash ./scripts/dependencies.sh
3332

3433
- name: Verify clean design files
3534
run: |
36-
kicad-cli sch erc -o ${workflow_project_dir}/outputs/erc_errors.json --format json --severity-error --exit-code-violations ${workflow_project_dir}/${kicad_project_name}.kicad_sch
37-
kicad-cli pcb drc -o ${workflow_project_dir}/outputs/drc_errors.json --format json --severity-error --exit-code-violations ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
35+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output 546878ce-2bd2-4fb6-b2a1-e67785afa624 ${workflow_project_dir}/${kicad_project_name}.kicad_pro
3836
3937
- name: Archive artifacts
4038
uses: actions/upload-artifact@v4
4139
if: always()
4240
with:
43-
name: design-artifacts
44-
path: ayab-esp32/outputs
41+
name: erc-drc-artifacts
42+
path: DesignChecks
Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,83 @@
1-
name: Assembly Documentation
1+
name: AYAB ESP32 Fabrication Outputs
22

33
on:
4+
workflow_dispatch:
5+
46
pull_request:
57
branches:
68
- main
79
types:
810
- closed
11+
paths:
12+
- ayab-esp32/**
913

1014
push:
1115
branches:
1216
- main
17+
paths:
18+
- ayab-esp32/**
1319

1420
env:
1521
workflow_project_dir: ayab-esp32
1622
kicad_project_name: ayab-esp32
1723

1824
jobs:
1925
buildfiles:
20-
if: github.event.pull_request.merged == true
2126
name: Design check & documentation build
2227
runs-on: ubuntu-latest
2328
steps:
2429
- name: Checkout code
2530
uses: actions/checkout@v4
2631

27-
- name: Create output directory
28-
run: mkdir -p ${workflow_project_dir}/outputs/gerbers
29-
3032
- name: Install KiCad
3133
run: sudo bash ./scripts/dependencies.sh
3234

33-
- name: Export design file PDFs
35+
- name: Export reference materials
3436
run: |
35-
kicad-cli sch export pdf -o ${workflow_project_dir}/pdf/${kicad_project_name}-sch.pdf ${workflow_project_dir}/${kicad_project_name}.kicad_sch
36-
kicad-cli pcb export pdf -o ${workflow_project_dir}/pdf/${kicad_project_name}-pcb-front.pdf -l "F.Cu,F.Mask,Edge.Cuts" ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
37-
kicad-cli pcb export pdf -o ${workflow_project_dir}/pdf/${kicad_project_name}-pcb-back.pdf --erd --ev --mirror -l "B.Cu,B.Mask,Edge.Cuts" ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
37+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output faf786cb-df2f-40b8-96a2-4a7fc03f48f1 ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
3838
39-
- name: Export assembly documentation
40-
run: |
41-
kicad-cli sch export bom -o ${workflow_project_dir}/outputs/raw-BOM.csv --fields "Reference,Value,Footprint,LCSC ID" --exclude-dnp --group-by "Val" --sort-asc ${workflow_project_dir}/${kicad_project_name}.kicad_sch
42-
kicad-cli pcb export pos -o ${workflow_project_dir}/outputs/raw-CPL.csv --side front --format csv --use-drill-file-origin --exclude-dnp ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
39+
sudo mv Reference/${kicad_project_name}.pdf Reference/${kicad_project_name}-schematic.pdf
40+
41+
copper_files=$(ls Reference/*Cu.pdf)
42+
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=Reference/${kicad_project_name}-assembly.pdf ${copper_files}
43+
sudo rm ${copper_files}
4344
44-
- name: Convert BOM & CPL to JLC format
45+
sudo mv Reference ${workflow_project_dir}/Reference
46+
47+
- name: Export gerbers and assembly documentation
4548
run: |
46-
python3 scripts/jlc_bom_formatter.py ${workflow_project_dir}/outputs/raw-BOM.csv ${workflow_project_dir}/outputs/${kicad_project_name}-BOM.csv
47-
python3 scripts/jlc_cpl_formatter.py ${workflow_project_dir}/outputs/raw-CPL.csv ${workflow_project_dir}/outputs/${kicad_project_name}-CPL.csv
48-
sudo rm ${workflow_project_dir}/outputs/raw-BOM.csv ${workflow_project_dir}/outputs/raw-CPL.csv
49+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output aeb40242-edfd-4f73-854b-b9cc9a052a15 ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
50+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output 6ee855ab-9a47-48ef-8c70-9a0d15a3c70a ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
4951
50-
- name: Export mechanical files
52+
- name: Convert BOM & CPL to JLC format
5153
run: |
52-
kicad-cli pcb export gerbers -o ${workflow_project_dir}/outputs/gerbers/ -l "F.Cu,F.Mask,F.Silkscreen,F.Paste,In1.Cu,In2.Cu,B.Cu,B.Mask,B.Silkscreen,B.Paste,Edge.Cuts"--erd --ev --use-drill-file-origin --no-protel-ext ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
53-
kicad-cli pcb export drill -o ${workflow_project_dir}/outputs/gerbers/ --drill-origin plot --format gerber ${workflow_project_dir}/${kicad_project_name}.kicad_pcb
54-
cd ${workflow_project_dir}/outputs
55-
zip -r ${kicad_project_name}-gerbers.zip gerbers
56-
sudo rm -r gerbers
54+
sudo mv Outputs/raw-pos-all-pos.csv Outputs/raw-pos.csv
55+
python3 scripts/jlc_bom_formatter.py Outputs/raw-bom.csv Outputs/${kicad_project_name}-BOM-JLC.csv
56+
python3 scripts/jlc_cpl_formatter.py Outputs/raw-pos.csv Outputs/${kicad_project_name}-CPL-JLC.csv
57+
58+
sudo mv Outputs/raw-bom.csv Outputs/${kicad_project_name}-bom.csv
59+
sudo mv Outputs/raw-pos.csv Outputs/${kicad_project_name}-pos.csv
5760
58-
- name: Add PDFs to repo
61+
- name: Add reference materials to repo
5962
env:
6063
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6164
run: |
62-
git config --global user.email "robot@ayab-knitting.com"
63-
git config --global user.name "AYAB Github Action"
64-
git fetch
65-
git checkout documentation
66-
git add ${workflow_project_dir}/pdf/*.pdf
65+
git config --global user.email "robot@ayabknitting.com"
66+
git config --global user.name "robot"
67+
git add ${workflow_project_dir}/Reference/*
6768
git commit -m "Add design file PDFs to repo [skip ci]"
68-
gh pr create --head documentation --base main --title "Add design file PDFs to repo" --body "Automated PR from GHA"
69+
git push -u origin main
6970
7071
- name: Archive artifacts
7172
uses: actions/upload-artifact@v4
7273
if: always()
7374
with:
7475
name: documentation-artifacts
75-
path: ayab-esp32/outputs
76+
path: Outputs/
77+
78+
- name: Archive artifacts
79+
uses: actions/upload-artifact@v4
80+
if: always()
81+
with:
82+
name: reference-artifacts
83+
path: ayab-esp32/Reference/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: AYAB Shield Hardware Check
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- ayab-shield/**
11+
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- ayab-shield/**
17+
18+
env:
19+
workflow_project_dir: ayab-shield
20+
kicad_project_name: arduino_shield
21+
22+
jobs:
23+
buildfiles:
24+
name: Design check & documentation build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Install KiCad
31+
run: sudo bash ./scripts/dependencies.sh
32+
33+
- name: Verify clean design files
34+
run: |
35+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output 546878ce-2bd2-4fb6-b2a1-e67785afa624 ${workflow_project_dir}/${kicad_project_name}.kicad_pro
36+
37+
- name: Archive artifacts
38+
uses: actions/upload-artifact@v4
39+
if: always()
40+
with:
41+
name: erc-drc-artifacts
42+
path: DesignChecks
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: AYAB Shield Fabrication Outputs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request:
7+
branches:
8+
- main
9+
types:
10+
- closed
11+
paths:
12+
- ayab-shield/**
13+
14+
push:
15+
branches:
16+
- main
17+
paths:
18+
- ayab-shield/**
19+
20+
env:
21+
workflow_project_dir: ayab-shield
22+
kicad_project_name: arduino_shield
23+
24+
jobs:
25+
buildfiles:
26+
name: Design check & documentation build
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Install KiCad
33+
run: sudo bash ./scripts/dependencies.sh
34+
35+
- name: Export reference materials
36+
run: |
37+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output faf786cb-df2f-40b8-96a2-4a7fc03f48f1 ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
38+
39+
sudo mv Reference/${kicad_project_name}.pdf Reference/${kicad_project_name}-schematic.pdf
40+
41+
copper_files=$(ls Reference/*Cu.pdf)
42+
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=Reference/${kicad_project_name}-assembly.pdf ${copper_files}
43+
sudo rm ${copper_files}
44+
45+
sudo mv Reference ${workflow_project_dir}/Reference
46+
47+
- name: Export gerbers and assembly documentation
48+
run: |
49+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output aeb40242-edfd-4f73-854b-b9cc9a052a15 ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
50+
kicad-cli jobset run --file ./ayab-library/ayab-jobset.kicad_jobset --output 6ee855ab-9a47-48ef-8c70-9a0d15a3c70a ./${workflow_project_dir}/${kicad_project_name}.kicad_pro
51+
52+
- name: Convert BOM & CPL to JLC format
53+
run: |
54+
sudo mv Outputs/raw-pos-all-pos.csv Outputs/raw-pos.csv
55+
python3 scripts/jlc_bom_formatter.py Outputs/raw-bom.csv Outputs/${kicad_project_name}-BOM-JLC.csv
56+
python3 scripts/jlc_cpl_formatter.py Outputs/raw-pos.csv Outputs/${kicad_project_name}-CPL-JLC.csv
57+
58+
sudo mv Outputs/raw-bom.csv Outputs/${kicad_project_name}-bom.csv
59+
sudo mv Outputs/raw-pos.csv Outputs/${kicad_project_name}-pos.csv
60+
61+
- name: Add reference materials to repo
62+
env:
63+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: |
65+
git config --global user.email "robot@ayabknitting.com"
66+
git config --global user.name "robot"
67+
git add ${workflow_project_dir}/Reference/*
68+
git commit -m "Add reference materials to repo [skip ci]"
69+
git push -u origin main
70+
71+
- name: Archive artifacts
72+
uses: actions/upload-artifact@v4
73+
if: always()
74+
with:
75+
name: documentation-artifacts
76+
path: Outputs/
77+
78+
- name: Archive artifacts
79+
uses: actions/upload-artifact@v4
80+
if: always()
81+
with:
82+
name: reference-artifacts
83+
path: ayab-shield/Reference/

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
ayab-esp32/datasheets/*
3-
*/Gerbers/*
4-
*gerbers.zip
3+
*/Outputs/*
4+
*/DesignChecks/*
5+
*.zip

ayab-esp32/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Hardware Design](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-design.yml/badge.svg?branch=main)](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-design.yml)
2-
[![Assembly Documentation](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-documentation.yml/badge.svg)](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-documentation.yml)
2+
[![Fabrication Outputs](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-documentation.yml/badge.svg)](https://github.com/AllYarnsAreBeautiful/ayab-hardware/actions/workflows/ayab-esp32-documentation.yml)
33

44
# AYAB-ESP32
55
These are the design files for the latest generation of AYAB hardware, a new, next controller for knitting machines.\
@@ -19,5 +19,6 @@ Based on the ESP32, many new features have been implemented:\
1919
The project was designed using KiCad 8. All symbols, footprints, and models are self contained to this repository so no additional files are required in order to view or modify the design.
2020

2121
![Prototype hardware assembly](images/ayab-esp32.png)
22+
![Live Render](Reference/top.png)
2223

2324
Questions? Comments? Great ideas? Talk with us in [#hardware-development on Discord](https://discord.gg/A8KE3jcCn2)!

ayab-esp32/board2pdf.config.ini

Lines changed: 0 additions & 9 deletions
This file was deleted.

ayab-esp32/images/render.png

-1.03 MB
Binary file not shown.

ayab-esp32/pdf/ayab-esp32.pdf

-2.22 MB
Binary file not shown.
-7.44 MB
Binary file not shown.

0 commit comments

Comments
 (0)