diff --git a/.github/actions/export-gerbers/action.yml b/.github/actions/export-gerbers/action.yml new file mode 100644 index 0000000..e46457b --- /dev/null +++ b/.github/actions/export-gerbers/action.yml @@ -0,0 +1,24 @@ +name: 'Export Gerbers' +description: 'Export Gerber files from a Kicad PCB' +inputs: + pcb_file: + description: 'Kicad input file' + required: true + gerbers_dir: + description: 'Gerbers folder' + required: true + fab: + description: 'Fabrication profile' + default: 'jlcpcb' + flags: + description: 'Additional flags for kikit fab' + default: '--no-assembly' +runs: + using: 'docker' + image: 'docker://yaqwsx/kikit:v0.7' + entrypoint: '/bin/sh' + args: + - '-c' + - | + mkdir -p $GITHUB_WORKSPACE/${{ inputs.gerbers_dir }} ; + kikit fab ${{ inputs.fab }} ${{ inputs.flags }} ${{ inputs.pcb_file }} ${{ inputs.gerbers_dir }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 548eacc..d8af859 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,21 @@ jobs: with: pcb_file: output/pcbs/board.kicad_pcb ses_file: output/pcbs/board.ses + - name: Export Gerbers for top plate + uses: ./.github/actions/export-gerbers + with: + pcb_file: output/pcbs/top.kicad_pcb + gerbers_dir: output/gerbers/top + - name: Export Gerbers for bottom plate + uses: ./.github/actions/export-gerbers + with: + pcb_file: output/pcbs/bottom.kicad_pcb + gerbers_dir: output/gerbers/bottom + - name: Export Gerbers for main PCB + uses: ./.github/actions/export-gerbers + with: + pcb_file: output/pcbs/board.kicad_pcb + gerbers_dir: output/gerbers/board - name: Persist output uses: actions/upload-artifact@v2 with: