Change workflow to use JobSets #17
Workflow file for this run
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 ESP32 Fabrication Outputs | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- ayab-esp32/** | |
push: | |
branches: | |
- main | |
paths: | |
- ayab-esp32/** | |
env: | |
workflow_project_dir: ayab-esp32 | |
kicad_project_name: ayab-esp32 | |
jobs: | |
buildfiles: | |
name: Design check & documentation build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install KiCad | |
run: sudo 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 | |
sudo mv 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} | |
sudo rm ${copper_files} | |
sudo mv 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: | | |
sudo 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 | |
sudo mv Outputs/raw-bom.csv Outputs/${kicad_project_name}-bom.csv | |
sudo mv Outputs/raw-pos.csv Outputs/${kicad_project_name}-pos.csv | |
- name: Add reference materials to repo | |
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 origin main | |
- 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-esp32/Reference/ |