Skip to content

Commit

Permalink
Update build pipeline to use Freerouting 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ceoloide committed Nov 14, 2024
1 parent a796785 commit c0230bc
Show file tree
Hide file tree
Showing 58 changed files with 10,669 additions and 105,465 deletions.
12 changes: 6 additions & 6 deletions .github/actions/autoroute/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ inputs:
required: true
runs:
using: 'docker'
image: 'docker://soundmonster/freerouting_cli:v0.1.0'
image: 'docker://ceoloide/ergogen:2.0.1'
entrypoint: '/bin/sh'
args:
- '-c'
- |
for board in ${{ inputs.boards }};
do
echo "Processing $board";
if [ -e ergogen/output/pcbs/${board}.ses ]; then
echo "Cleaning up ergogen/output/pcbs/${board}.ses";
rm -f ergogen/output/pcbs/${board}.ses;
if [ -e pcbs/${board}.ses ]; then
echo "Cleaning up pcbs/${board}.ses";
rm -f pcbs/${board}.ses;
fi
if [ -e ergogen/output/pcbs/${board}.dsn ]; then
if [ -e pcbs/${board}.dsn ]; then
echo "Autoroute PCB";
java -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
java -jar /opt/freerouting.jar -de pcbs/${board}.dsn -do pcbs/${board}.ses --user-data-path ./freerouting -mp 20 -mt 1 -dct 0 --gui.enabled=false [email protected]
fi
done
10 changes: 5 additions & 5 deletions .github/actions/export-dsn/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ runs:
for board in ${{ inputs.boards }};
do
echo "Processing $board";
if [ -e $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn ]; then
echo "Cleaning up $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn";
rm -f $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn;
if [ -e $GITHUB_WORKSPACE/pcbs/${board}.dsn ]; then
echo "Cleaning up $GITHUB_WORKSPACE/pcbs/${board}.dsn";
rm -f $GITHUB_WORKSPACE/pcbs/${board}.dsn;
fi
if [ -e ergogen/output/pcbs/${board}.kicad_pcb ]; then
if [ -e pcbs/${board}.kicad_pcb ]; then
echo "Export DSN";
$GITHUB_WORKSPACE/kibot/export_dsn.py -b $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb -o $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.dsn
$GITHUB_WORKSPACE/kibot/export_dsn.py -b $GITHUB_WORKSPACE/pcbs/${board}.kicad_pcb -o $GITHUB_WORKSPACE/pcbs/${board}.dsn
fi
done
10 changes: 5 additions & 5 deletions .github/actions/import-ses/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ runs:
for board in ${{ inputs.boards }};
do
echo "Processing $board";
if [ -e $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_autorouted.kicad_pcb ]; then
echo "Cleaning up $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_autorouted.kicad_pcb";
rm -f $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_autorouted.kicad_pcb;
if [ -e $GITHUB_WORKSPACE/pcbs/${board}_autorouted.kicad_pcb ]; then
echo "Cleaning up $GITHUB_WORKSPACE/pcbs/${board}_autorouted.kicad_pcb";
rm -f $GITHUB_WORKSPACE/pcbs/${board}_autorouted.kicad_pcb;
fi
if [ -e $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.ses ]; then
if [ -e $GITHUB_WORKSPACE/pcbs/${board}.ses ]; then
echo "Import SES";
$GITHUB_WORKSPACE/kibot/import_ses.py -b $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb -s $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.ses -o $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}_autorouted.kicad_pcb
$GITHUB_WORKSPACE/kibot/import_ses.py -b $GITHUB_WORKSPACE/pcbs/${board}.kicad_pcb -s $GITHUB_WORKSPACE/pcbs/${board}.ses -o $GITHUB_WORKSPACE/pcbs/${board}_autorouted.kicad_pcb
fi
done
2 changes: 1 addition & 1 deletion .github/actions/kibot/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ runs:
for board in ${{ inputs.boards }};
do
echo "Processing $board";
kibot -b $GITHUB_WORKSPACE/ergogen/output/pcbs/${board}.kicad_pcb -c $GITHUB_WORKSPACE/kibot/${{ inputs.config }}.kibot.yaml
kibot -b $GITHUB_WORKSPACE/pcbs/${board}.kicad_pcb -c $GITHUB_WORKSPACE/kibot/${{ inputs.config }}.kibot.yaml
done
10 changes: 7 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- 'kibot/*'
- 'freerouting/*'
- 'package.json'
- '*.nix'

name: Build
jobs:
Expand Down Expand Up @@ -64,5 +63,10 @@ jobs:
- name: Persist output
uses: actions/upload-artifact@v4
with:
name: corney_island
path: ergogen/output
name: not_about_money
path: |
cases
gerbers
images
outlines
pcbs
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ logs
.DS_Store

# ergogen
ergogen/output/outlines/_*.*
ergogen/output/pcbs/_*.*
ergogen/output/outlines/*.yaml
ergogen/output/points
ergogen/output/source
outlines/_*.*
outlines/*.yaml
pcbs/_*.*
points
source

# npm
node_modules

# gerbers
ergogen/output/gerbers/*/*
!ergogen/output/gerbers/*/*.zip
gerbers/*/*
!gerbers/*/*.zip
66 changes: 30 additions & 36 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ boards="corney_island_wireless corney_island"
plates="backplate frontplate controller_overlay"

# Define the KiCad Auto Docker image to use
kicad_auto_image="setsoft/kicad_auto:ki8"
# kicad_auto_image="ceoloide/kicad_auto:nightly"
# freerouting_cli_image="ceoloide/kicad_auto:nightly"
freerouting_cli_image="soundmonster/freerouting_cli:v0.1.0"
kicad_auto_image="ghcr.io/inti-cmnb/kicad8_auto:latest"
freerouting_cli_image="ceoloide/ergogen:2.0.1"

# Preserve manually routed files
if [ -e ergogen/output/pcbs/*_manually_routed.kicad_pcb ]; then
if [ -e pcbs/*_manually_routed.kicad_pcb ]; then
mkdir ergogen/tmp
mv ergogen/output/pcbs/*_manually_routed* ergogen/tmp
mv pcbs/*_manually_routed* ergogen/tmp
fi

# Cleanup the output folder or KiCad will error out
rm -rf ergogen/output
rm -rf outlines
rm -rf pcbs
rm -rf points
rm -rf source
rm -rf cases

# Cleanup Freerouting log outpus
if [ -e freerouting/freerouting.log ]; then
Expand All @@ -36,59 +38,51 @@ npm run debug

# Restore manually routed files
if [ -e ergogen/tmp/*_manually_routed.kicad_pcb ]; then
mv ergogen/tmp/*_manually_routed* ergogen/output/pcbs
mv ergogen/tmp/*_manually_routed* pcbs
rm -r ergogen/tmp
fi


if [ ! -e freerouting/freerouting-2.0.0.jar ]; then
curl https://github.com/freerouting/freerouting/releases/download/v2.0.0/freerouting-2.0.0.jar -L -o freerouting/freerouting-2.0.0.jar
if [ ! -e freerouting/freerouting-2.0.1.jar ]; then
curl https://github.com/freerouting/freerouting/releases/download/v2.0.1/freerouting-2.0.1.jar -L -o freerouting/freerouting-2.0.1.jar
fi

if [ ! -e freerouting/freerouting-SNAPSHOT.jar ]; then
curl https://github.com/freerouting/freerouting/releases/download/SNAPSHOT/freerouting-SNAPSHOT-20241021_120600.jar -L -o freerouting/freerouting-SNAPSHOT.jar
curl https://github.com/freerouting/freerouting/releases/download/SNAPSHOT/freerouting-SNAPSHOT-20241111_140100.jar -L -o freerouting/freerouting-SNAPSHOT.jar
fi

for plate in ${plates}
do
echo "\n\n>>>>>> Processing $plate <<<<<<\n\n"
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b ergogen/output/pcbs/${plate}.kicad_pcb -c kibot/default.kibot.yaml
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b pcbs/${plate}.kicad_pcb -c kibot/default.kibot.yaml
done

for board in ${boards}
do
echo "\n\n>>>>>> Processing $board <<<<<<\n\n"
if [ -e ergogen/output/pcbs/${board}_manually_routed.kicad_pcb ]; then
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b ergogen/output/pcbs/${board}_manually_routed.kicad_pcb -c kibot/boards.kibot.yaml
if [ -e pcbs/${board}_manually_routed.kicad_pcb ]; then
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b pcbs/${board}_manually_routed.kicad_pcb -c kibot/boards.kibot.yaml
fi
if [ -e ergogen/output/pcbs/${board}.kicad_pcb ]; then
if [ -e pcbs/${board}.kicad_pcb ]; then
echo Export DSN
${container_cmd} run ${container_args} ${kicad_auto_image} kibot/export_dsn.py -b ergogen/output/pcbs/${board}.kicad_pcb -o ergogen/output/pcbs/${board}.dsn
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b ergogen/output/pcbs/${board}.kicad_pcb -c kibot/default.kibot.yaml
${container_cmd} run ${container_args} ${kicad_auto_image} kibot/export_dsn.py -b pcbs/${board}.kicad_pcb -o pcbs/${board}.dsn
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b pcbs/${board}.kicad_pcb -c kibot/default.kibot.yaml
fi
if [ -e ergogen/output/pcbs/${board}.dsn ]; then
if [ -e pcbs/${board}.dsn ]; then
echo Autoroute PCB
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-1.6.5.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-1.7.0.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-1.8.0.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20 -dct 1
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-1.9.0.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20 -dct 1
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-2.0.0.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20 -dct 1
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-test.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20 -dct 1
# xvfb-run -a java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-SNAPSHOT.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20 -dct 1
# ${container_cmd} run ${container_args} ${freerouting_cli_image} java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar /opt/freerouting_cli.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
# ${container_cmd} run ${container_args} nixos/nix nix-shell --argstr board ${board}
java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-SNAPSHOT.jar -de ergogen/output/pcbs/${board}.dsn -do ergogen/output/pcbs/${board}.ses --user-data-path ./freerouting -mp 20 -mt 1 -dct 0 --gui.enabled=false [email protected]
# ${container_cmd} run ${container_args} ${freerouting_cli_image} java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar /opt/freerouting_cli.jar -de pcbs/${board}.dsn -do pcbs/${board}.ses -dr freerouting/freerouting.rules -mp 20
${container_cmd} run ${container_args} ${freerouting_cli_image} java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar /opt/freerouting.jar -de pcbs/${board}.dsn -do pcbs/${board}.ses --user-data-path ./freerouting -mp 20 -mt 1 -dct 0 --gui.enabled=false [email protected]
# java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-2.0.1.jar -de pcbs/${board}.dsn -do pcbs/${board}.ses --user-data-path ./freerouting -mp 20 -mt 1 -dct 0 --gui.enabled=false [email protected]
# java -Dlog4j.configurationFile=file:./freerouting/log4j2.xml -jar freerouting/freerouting-SNAPSHOT.jar -de pcbs/${board}.dsn -do pcbs/${board}.ses --user-data-path ./freerouting -mp 20 -mt 1 -dct 0 --gui.enabled=false [email protected]
fi
if [ -e ergogen/output/pcbs/${board}.ses ]; then
if [ -e pcbs/${board}.ses ]; then
echo "Import SES"
# ${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /bin/sh -c "mkdir -p $HOME/.config/kicad; cp /root/.config/kicad/* $HOME/.config/kicad"
# ${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py ergogen/output/pcbs/${board}.kicad_pcb ergogen/output/pcbs/${board}.ses --output-file ergogen/output/pcbs/${board}_autorouted.kicad_pcb
${container_cmd} run ${container_args} ${kicad_auto_image} kibot/import_ses.py -b ergogen/output/pcbs/${board}.kicad_pcb -s ergogen/output/pcbs/${board}.ses -o ergogen/output/pcbs/${board}_autorouted.kicad_pcb
# sed -i -e 's/(version 20231007)/(version 20221018)/g' ergogen/output/${board}_autorouted.kicad_pcb
# ${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py pcbs/${board}.kicad_pcb pcbs/${board}.ses --output-file pcbs/${board}_autorouted.kicad_pcb
${container_cmd} run ${container_args} ${kicad_auto_image} kibot/import_ses.py -b pcbs/${board}.kicad_pcb -s pcbs/${board}.ses -o pcbs/${board}_autorouted.kicad_pcb
# sed -i -e 's/(version 20231007)/(version 20221018)/g' ${board}_autorouted.kicad_pcb
fi
if [ -e ergogen/output/pcbs/${board}_autorouted.kicad_pcb ]; then
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b ergogen/output/pcbs/${board}_autorouted.kicad_pcb -c kibot/boards.kibot.yaml
if [ -e pcbs/${board}_autorouted.kicad_pcb ]; then
${container_cmd} run ${container_args} ${kicad_auto_image} kibot -b pcbs/${board}_autorouted.kicad_pcb -c kibot/boards.kibot.yaml
fi
done

Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c0230bc

Please sign in to comment.