CAN_Utility_Board/.allspice/workflows/jlc.yml

64 lines
2.0 KiB
YAML

name: manufacturing-outputs
on:
push:
release:
types: [published, edited]
jobs:
generate-outputs:
runs-on: ubuntu-latest
container:
image: allspice/kicad:8.0-releases
steps:
- name: "Check out repository code"
uses: actions/checkout@v4
- name: "Set and print variables"
id: vars
run: |
PCB_FILE="$( (find . -type f -name "*.kicad_pcb" -print &) | head -n 1)"
echo "PCB_FILE=${PCB_FILE}"
echo "PCB_FILE=${PCB_FILE}" >> $GITHUB_OUTPUT
SCH_FILE="$( (find . -type f -name "*.kicad_sch" -print &) | head -n 1)"
echo "SCH_FILE=${SCH_FILE}"
echo "SCH_FILE=${SCH_FILE}" >> $GITHUB_OUTPUT
PRO_FILE="$( (find . -type f -name "*.kicad_pro" -print &) | head -n 1)"
echo "PRO_FILE=${PRO_FILE}"
echo "PRO_FILE=${PRO_FILE}" >> $GITHUB_OUTPUT
# DRC
- name: "Run DRC"
run: kicad-cli pcb drc --severity-error --exit-code-violations --output drc.rpt "${{ steps.vars.outputs.PCB_FILE }}"
- name: Upload DRC as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: DRC
path: drc.rpt
# BOM
- name: "Create BOM"
run: kicad-cli sch export bom --output bom.csv "${{ steps.vars.outputs.SCH_FILE }}"
- name: Upload BOM as artifact
uses: actions/upload-artifact@v3
with:
name: BOM
path: bom.csv
# Gerbers
- name: "Generate Gerber files in JLCPCB format"
run: |
mkdir gerbers
kicad-cli pcb export gerbers --output ./gerbers/ --layers "F.Cu,B.Cu,F.Paste,B.Paste,F.Silkscreen,B.Silkscreen,F.Mask,B.Mask,Edge.Cuts" --subtract-soldermask "${{ steps.vars.outputs.PCB_FILE }}"
kicad-cli pcb export drill --output ./gerbers/ "${{ steps.vars.outputs.PCB_FILE }}"
- name: Upload Gerbers as artifact
uses: actions/upload-artifact@v3
with:
name: gerbers.zip
path: gerbers