Merge pull request #68 from AllYarnsAreBeautiful/footprints2 #70
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: AYAB Shield Fabrication Outputs | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- ayab-shield/** | |
env: | |
workflow_project_dir: ayab-shield | |
kicad_project_name: arduino_shield | |
jobs: | |
buildfiles: | |
name: Design check & documentation build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install KiCad | |
run: bash ./scripts/dependencies.sh | |
- name: Export reference materials | |
run: | | |
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 | |
mv -v Reference/${kicad_project_name}.pdf Reference/${kicad_project_name}-schematic.pdf | |
copper_files=$(ls Reference/*Cu.pdf) | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=Reference/${kicad_project_name}-assembly.pdf ${copper_files} | |
rm -v ${copper_files} | |
rm -rfv ${workflow_project_dir}/Reference | |
mv -v Reference ${workflow_project_dir}/Reference | |
- name: Export gerbers and assembly documentation | |
run: | | |
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 | |
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 | |
- name: Convert BOM & CPL to JLC format | |
run: | | |
mv Outputs/raw-pos-all-pos.csv Outputs/raw-pos.csv | |
python3 scripts/jlc_bom_formatter.py Outputs/raw-bom.csv Outputs/${kicad_project_name}-BOM-JLC.csv | |
python3 scripts/jlc_cpl_formatter.py Outputs/raw-pos.csv Outputs/${kicad_project_name}-CPL-JLC.csv | |
mv Outputs/raw-bom.csv Outputs/${kicad_project_name}-bom.csv | |
mv Outputs/raw-pos.csv Outputs/${kicad_project_name}-pos.csv | |
- name: Add reference materials to repo | |
if: ${{ github.ref != 'refs/heads/main' }} # can't push to a protected branch | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "robot@ayabknitting.com" | |
git config --global user.name "robot" | |
git add ${workflow_project_dir}/Reference/* | |
git commit -m "Add design file PDFs to repo [skip ci]" | |
git push | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: documentation-artifacts | |
path: Outputs/ | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: reference-artifacts | |
path: ayab-shield/Reference/ |