Updated config schema, improved demo #166
Workflow file for this run
This file contains 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: Export Electronics | |
on: | |
push: | |
pull_request: | |
jobs: | |
export-electronics: | |
name: Export Electronics | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up outputs directory | |
run: mkdir -p electronics/build/outputs | |
- name: Install dependencies | |
run: ./electronics/scripts/dependencies.sh | |
- name: Export JLCPCB fabrication files [view_base] | |
run: | | |
./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb | |
cp -r electronics/build/view_base-jlc electronics/build/outputs | |
- name: Export PCB overview PDF [view_base] | |
run: | | |
./electronics/scripts/generate_pdf.py --release-prefix releases/view_base/ electronics/view_base/view_base.kicad_pcb | |
cp electronics/build/view_base-pcb-packet.pdf electronics/build/outputs | |
env: | |
PYTHONUNBUFFERED: 1 | |
- name: Export JLCPCB fabrication files [view_screen] | |
run: | | |
./electronics/scripts/export_jlcpcb.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb | |
cp -r electronics/build/view_screen-jlc electronics/build/outputs | |
- name: Export PCB overview PDF [view_screen] | |
run: | | |
./electronics/scripts/generate_pdf.py --release-prefix releases/view_screen/ electronics/view_screen/view_screen.kicad_pcb | |
cp electronics/build/view_screen-pcb-packet.pdf electronics/build/outputs | |
env: | |
PYTHONUNBUFFERED: 1 | |
- name: Export artifacts (KiBot) [view_base] | |
uses: INTI-CMNB/KiBot@db2185ac51d83f729e632c38e23b2d9df7ccd460 | |
with: | |
config: electronics/view_base/view_base.kibot.yml | |
dir: electronics/build/outputs | |
schema: 'electronics/view_base/view_base.kicad_sch' | |
board: 'electronics/view_base/view_base.kicad_pcb' | |
- name: Export artifacts (KiBot) [view_screen] | |
uses: INTI-CMNB/KiBot@db2185ac51d83f729e632c38e23b2d9df7ccd460 | |
with: | |
config: electronics/view_screen/view_screen.kibot.yml | |
dir: electronics/build/outputs | |
schema: 'electronics/view_screen/view_screen.kicad_sch' | |
board: 'electronics/view_screen/view_screen.kicad_pcb' | |
- name: Update 3D artifacts [view_base] | |
# Need to chown files back to runner, as ownership gets set to root by the KiBot Actions | |
run: | | |
sudo chown runner:docker electronics/build/outputs/* | |
mv electronics/build/outputs/view_base-3D_top.png electronics/build/outputs/view_base-front-3d.png | |
./scripts/annotate_image.sh electronics/build/outputs/view_base-front-3d.png | |
mv electronics/build/outputs/view_base-3D_bottom.png electronics/build/outputs/view_base-back-3d.png | |
./scripts/annotate_image.sh electronics/build/outputs/view_base-back-3d.png | |
env: | |
PYTHONUNBUFFERED: 1 | |
- name: Update 3D artifacts [view_screen] | |
# Need to chown files back to runner, as ownership gets set to root by the KiBot Actions | |
run: | | |
sudo chown runner:docker electronics/build/outputs/* | |
mv electronics/build/outputs/view_screen-3D_top.png electronics/build/outputs/view_screen-front-3d.png | |
./scripts/annotate_image.sh electronics/build/outputs/view_screen-front-3d.png | |
mv electronics/build/outputs/view_screen-3D_bottom.png electronics/build/outputs/view_screen-back-3d.png | |
./scripts/annotate_image.sh electronics/build/outputs/view_screen-back-3d.png | |
env: | |
PYTHONUNBUFFERED: 1 | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: electronics | |
path: | | |
electronics/build | |
- name: Configure AWS Credentials | |
if: github.event_name == 'push' && github.repository_owner == 'scottbez1' | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Sync artifacts to S3 | |
if: github.event_name == 'push' && github.repository_owner == 'scottbez1' | |
run: | | |
aws s3 sync electronics/build/outputs s3://smartknob-artifacts/${GITHUB_REF#refs/heads/}/electronics --delete --cache-control max-age=0,no-cache | |