diff --git a/.github/actions/autoroute/action.yaml b/.github/actions/autoroute/action.yaml new file mode 100644 index 0000000..b545d12 --- /dev/null +++ b/.github/actions/autoroute/action.yaml @@ -0,0 +1,18 @@ +name: 'Autoroute' +description: 'Autoroute a given DSN file to SES with FreeRouting' +inputs: + boards: + description: 'Specctra SES output file' + required: true +runs: + using: 'docker' + image: 'docker://soundmonster/freerouting_cli:v0.1.0' + entrypoint: '/bin/sh' + args: + - '-c' + - | + for board in ${{ inputs.boards }}; + do + echo Processing $board + java -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses + done \ No newline at end of file diff --git a/.github/actions/export-dsn/action.yaml b/.github/actions/export-dsn/action.yaml new file mode 100644 index 0000000..82ebd4e --- /dev/null +++ b/.github/actions/export-dsn/action.yaml @@ -0,0 +1,21 @@ +name: 'Export DSN' +description: 'Export Specctra DSN from a Kicad PCB' +inputs: + boards: + description: 'Board names' + required: true +runs: + using: 'docker' + image: 'docker://soundmonster/kicad-automation-scripts:latest' + entrypoint: '/bin/sh' + args: + - '-c' + # GH actions set $HOME to a weird location and we have to move Kicad settings there first + - | + mkdir -p $HOME/.config/kicad ; + cp /root/.config/kicad/* $HOME/.config/kicad ; + for board in ${{ inputs.boards }}; + do + echo Processing $board + /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/export_dsn.py $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn + done \ No newline at end of file diff --git a/.github/actions/export-gerbers/action.yaml b/.github/actions/export-gerbers/action.yaml new file mode 100644 index 0000000..09bb70c --- /dev/null +++ b/.github/actions/export-gerbers/action.yaml @@ -0,0 +1,25 @@ +name: 'Export Gerbers' +description: 'Export Gerber files from a Kicad PCB' +inputs: + boards: + description: 'Board name' + 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' + - | + for board in ${{ inputs.boards }}; + do + echo Processing $board + mkdir -p $GITHUB_WORKSPACE/ergogen/output/gerbers/${board} ; + kikit fab ${{ inputs.fab }} ${{ inputs.flags }} $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_routed.kicad_pcb $GITHUB_WORKSPACE/ergogen/output/gerbers/${board} + done \ No newline at end of file diff --git a/.github/actions/import-ses/action.yaml b/.github/actions/import-ses/action.yaml new file mode 100644 index 0000000..499da8a --- /dev/null +++ b/.github/actions/import-ses/action.yaml @@ -0,0 +1,21 @@ +name: 'Import SES to Kicad' +description: 'Import Specctra SES into a Kicad PCB' +inputs: + boards: + description: 'Board name' + required: true +runs: + using: 'docker' + image: 'docker://soundmonster/kicad-automation-scripts:latest' + entrypoint: '/bin/sh' + args: + - '-c' + # GH actions set $HOME to a weird location and we have to move Kicad settings there first + - | + mkdir -p $HOME/.config/kicad ; + cp /root/.config/kicad/* $HOME/.config/kicad ; + for board in ${{ inputs.boards }}; + do + echo Processing $board + /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb $GITHUB_WORKSPACE/output/pcbs/${board}.ses --output-file $GITHUB_WORKSPACE/output/pcbs/${board}_routed.kicad_pcb; + done \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ae3301c..aa158dd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,8 +21,28 @@ jobs: run: npm install - name: Generate unrouted PCBs with Ergogen (definition in package.json) run: npm run gen + - name: Export DSN + uses: ./.github/actions/export-dsn + with: + boards: corney_island + - name: Autoroute PCB + uses: ./.github/actions/autoroute + with: + boards: corney_island + - name: Import SES + uses: ./.github/actions/import-ses + with: + boards: corney_island + - name: DRC check + uses: ./.github/actions/run-drc + with: + boards: corney_island + - name: Export Gerbers + uses: ./.github/actions/export-gerbers + with: + boards: corney_island - name: Persist output uses: actions/upload-artifact@v3 with: - name: unrouted-pcb - path: ergogen/output/pcbs \ No newline at end of file + name: corney_island + path: ergogen/output \ No newline at end of file