Skip to content

Commit

Permalink
adding current prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
slimcdk committed Nov 19, 2023
1 parent ff95c1a commit 050f0a5
Show file tree
Hide file tree
Showing 40 changed files with 3,513 additions and 878 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM setsoft/kicad_auto

RUN apt-get update && apt-get install -y git
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "Kibot",
"build": {
"dockerfile": "Dockerfile",
"context": "."
},
"postCreateCommand": {
"submodules": "git submodule update --init --recursive"
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
],
"runArgs": [
"--privileged"
],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/act-asdf:2": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.20"
},
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2.1.0": {},
"ghcr.io/eliises/devcontainer-features/devcontainers-cli:1": {},
"ghcr.io/devcontainers-contrib/features/grpcurl-asdf:2": {}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml"
]
}
}
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
88 changes: 88 additions & 0 deletions .github/workflows/compile-production-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Compile production files

on:
workflow_dispatch:
push:


jobs:

compile-production-files:
runs-on: ubuntu-latest
# needs: esphome-firmware-validation

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Generate full documentation
uses: INTI-CMNB/KiBot@v2_k7
env:
MOUSER_KEY: ${{ secrets.MOUSER_KEY }}
NEXAR_CLIENT_ID: ${{ secrets.NEXAR_CLIENT_ID }}
NEXAR_CLIENT_SECRET: ${{ secrets.NEXAR_CLIENT_SECRET }}
TME_TOKEN: ${{ secrets.TME_TOKEN }}
TME_APP_SECRET: ${{ secrets.TME_APP_SECRET }}
with:
dir: .
config: .kibot/full-outputs.kibot.yaml
schema: electronics/driver-board.kicad_sch
board: electronics/driver-board.kicad_pcb
install3D: yes

- name: Fix file permissions for generated files
run: sudo chown -R $(id -u):$(id -g) ./exports

- name: Get current date and time
id: gitstamp
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
# run: echo "::set-output name=datehash::$(git log -1 --format='%as')-$(git log -1 --pretty=format:%h)"
run: echo "datehash=$(git log -1 --format='%as')-$(git log -1 --pretty=format:%h)" >> $GITHUB_OUTPUT

# TODO: dynamic expand all images with date and commit hash
# - name: Copy renders to generated folder
# run: |
# set -e
# FONT=".github/artifacts/fonts/RobotoMono-Bold.ttf"
# set -v
# LABEL="`${{ steps.date.outputs.date }}`\n`git rev-parse --short HEAD`"
# convert -background black -fill white -pointsize 12 -font "$FONT" -size 300x36 label:"$LABEL" -bordercolor black -border 3 exports/renders/*.png +swap -append exports/renders/*.png

- name: Commit renders to generated folder
run: |
mkdir -p generated/images/
cp -r exports/renders/*.png generated/images/
git config user.name github-actions
git config user.email [email protected]
git add -f generated/images
git commit -m "latest renders"
git push
- name: Archive project artifacts
uses: actions/upload-artifact@v3
with:
name: driver-board-${{ steps.gitstamp.outputs.datehash }}
if-no-files-found: error
path: |
# Documentations
exports/driver-board-schematic-*.pdf
exports/driver-board-pcb-layers-*.pdf
exports/driver-board-pcb-layers-*.pdf
exports/driver-board-design-report-*.txt
exports/datasheets
exports/driver-board-ibom-*.html
exports/driver-board-*.csv
exports/driver-board-*.xlsx
# Production files
exports/driver-board-gerbers-*.zip
exports/driver-board-bom-*.csv
## Extras
exports/renders/*.png
exports/renders/*.jpg
exports/driver-board-*.step
exports/project
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/kicad,freecad,linux,windows,macos
# End of https://www.toptal.com/developers/gitignore/api/kicad,freecad,linux,windows,macos



*.zip

docs/src/*
exports/*

*.ogv
*.log
.env
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "electronics/kicad-libraries"]
path = electronics/kicad-libraries
path = dependencies/kicad-libraries
url = [email protected]:slimcdk/kicad-libraries.git
44 changes: 44 additions & 0 deletions .kibot/full-outputs.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
kibot:
version: 1

preflight:
run_erc: false
run_drc: false
check_zone_fills: true
ignore_unconnected: true
update_xml: true
set_text_variables:
- name: date
command: git log -1 --format='%as'
- name: commit
command: git log -1 --pretty=format:%h

global:
output: "%f-%i.%x"
environment:
extra_os:
- name: SLIMC_3DMODELS
value: dependencies/kicad-libraries/slimc/3d-packages
- name: ESPRESSIF_3DMODELS
value: dependencies/kicad-libraries/espressif-kicad-libraries/3dmodels/espressif.3dshapes

field_lcsc_part: LCSC
field_tolerance: Tolerance
field_voltage: Voltage
field_package: Package
hide_excluded: true
cross_using_kicad: true
pcb_material: FR4
pcb_finish: HAL
silk_screen_color: white
solder_mask_color: black

import:
- generators/project.kibot.yaml
- generators/sch-docs.kibot.yaml
- generators/pcb-docs.kibot.yaml
- generators/gerbers.kibot.yaml
- generators/bom.kibot.yaml
# - generators/renders.kibot.yaml
- generators/design-report.kibot.yaml
- generators/datasheets.kibot.yaml
76 changes: 76 additions & 0 deletions .kibot/generators/bom.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
kibot:
version: 1

outputs:
- type: bom
dir: exports
name: BoM
options:
output: "%f-%i-%r.%x"

- type: bom
name: BoM with Prices
comment: "Bill of Materials with prices"
dir: exports
options:
output: "%f-%i-%r.%x"
use_alt: true
number: 1
group_fields: ["Part", "Value", "Voltage", "Tolerance"]
columns:
- References
- Part
- Value
- Voltage
- Tolerance
- Quantity Per PCB
- field: Manf
name: Manufacturer
- field: Manf#
name: Manufacturer P/N
xlsx:
kicost: true
specs: false
kicost_api_disable:
- KitSpace
- Digi-Key
# - TME
- Element14
- Mouser
specs_columns:
- field: _field_lcsc_part
group_fields_fallbacks: ["Part", "Value", "Voltage", "Tolerance"]
distributors:
# - Arrow
- DigiKey
# - Farnell
- LCSC
- Mouser
# - Newark
# - RS
# - TME

- type: ibom
name: Interactive BOM
dir: exports
options:
output: "%f-%i-%r.%x"

# - type: kicost
# name: Costs
# dir: exports
# options:
# output: "%f-%i-%r.%x"
# number: 1

# - type: kibom
# name: KiBOM
# dir: exports/
# options:
# format: CSV
# csv:
# quote_all: false
# separator: ','
# hide_header: false
# hide_pcb_info: false
# hide_stats_info: false
7 changes: 7 additions & 0 deletions .kibot/generators/datasheets.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kibot:
version: 1

outputs:
- type: download_datasheets
name: Fetch datasheets
dir: exports/datasheets
11 changes: 11 additions & 0 deletions .kibot/generators/design-report.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kibot:
version: 1

outputs:
- type: report
name: Design report
dir: exports
options:
output: "%f-design-report-%r.%x"
convert_to: pdf # pdf file will placed in root
do_convert: false # apt install -y pandoc texlive-latex-base texlive-latex-recommended
72 changes: 72 additions & 0 deletions .kibot/generators/gerbers.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
kibot:
version: 1

outputs:
- name: Gerbers
type: gerber
dir: exports/gerbers
options:
exclude_edge_layer: true
exclude_pads_from_silkscreen: true
plot_sheet_reference: false
plot_footprint_refs: true
plot_footprint_values: true
force_plot_invisible_refs_vals: false
tent_vias: true
use_protel_extensions: true
create_gerber_job_file: false
output: "%f.%x"
gerber_precision: 4.6
use_gerber_x2_attributes: false
use_gerber_net_attributes: false
disable_aperture_macros: true
line_width: 0.1
subtract_mask_from_silk: false
inner_extension_pattern: ".gl%N"
layers:
- copper
- F.SilkS
- B.SilkS
- F.Mask
- B.Mask
- F.Paste
- B.Paste
- Edge.Cuts

- name: Drill
type: excellon
dir: exports/gerbers
options:
metric_units: false
minimal_header: true
zeros_format: SUPPRESS_LEADING
left_digits: 2
right_digits: 4
pth_and_npth_single_file: false
pth_id: ""
npth_id: "-NPTH"
output: "%f%i.drl"

- type: gerb_drill
name: Gerber Drill
dir: exports/gerbers

- type: position
name: PnP file
dir: exports/gerbers

- name: Archive
type: compress
dir: exports
options:
format: ZIP
output: "%f-gerbers-%r.%x"
files:
- from_output: "Gerbers"
dest: /
- from_output: "Drill"
dest: /
- from_output: "Gerber Drill"
dest: /
- from_output: "PnP file"
dest: /
Loading

0 comments on commit 050f0a5

Please sign in to comment.