Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemensElflein committed Oct 12, 2024
0 parents commit a1edc7c
Show file tree
Hide file tree
Showing 76 changed files with 1,812,424 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/kibot-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

env:
BOARD_NAME: "hw-openmower-universal"

on:
push:
paths-ignore:
- "**.md"

pull_request:
branches:
- 'main'

workflow_dispatch:

# Allow to stop obsolete workflows
concurrency:
group: ci-buildtrain-${{ github.ref }}-1
cancel-in-progress: true



jobs:

kibot:
runs-on: ubuntu-latest
if: github.ref_type != 'tag'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: INTI-CMNB/KiBot@v2_k8
with:
config: ".kibot.yaml"
board: "${{ env.BOARD_NAME }}.kicad_pcb"
verbose: 1
- uses: actions/upload-artifact@v4
with:
name: "${{ env.BOARD_NAME }}-${{ github.ref_name }}" # Use the tag as the artifact name
path: release

tagged-release:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: INTI-CMNB/KiBot@v2_k8
with:
config: ".kibot.yaml"
board: "${{ env.BOARD_NAME }}.kicad_pcb"

- name: 'Fix permissions on release/'
run: sudo chmod 0777 release
# Zip the release directory and include the tag (version) in the filename
- name: Compress release directory into a versioned ZIP file
run: zip -r "release-${{ env.BOARD_NAME }}-${GITHUB_REF_NAME}.zip" release/*
- uses: actions/upload-artifact@v4
with:
name: "release-${{ env.BOARD_NAME }}-${{ github.ref_name }}" # Use the tag as the artifact name
path: release

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: "release-${{ env.BOARD_NAME }}-${{ github.ref_name }}.zip"

- name: Deploy release
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: release
destination_dir: release



36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# For PCBs designed using KiCad: https://www.kicad.org/
# Format documentation: https://kicad.org/help/file-formats/

# Temporary files
*.000
*.bak
*.bck
*.kicad_pcb-bak
*.kicad_sch-bak
*-backups
*.kicad_prl
*.sch-bak
*~
_autosave-*
\#auto_saved_files\#
*.tmp
*-save.pro
*-save.kicad_pcb
fp-info-cache

# Netlist files (exported from Eeschema)
*.net

# Autorouter files (exported from Pcbnew)
*.dsn
*.ses

# Exported BOM files
*.xml
*.csv

*.lck

components/extern/tmp/

release/
191 changes: 191 additions & 0 deletions .kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
kibot:
version: 1

import:
- file: .kibot/jlcpcb_rotation_filter.yaml

preflight:
run_erc: false
run_drc: false
set_text_variables:
- name: 'git_version'
# Replace n.m.i with n.m."x"
command: >
git describe --tags || git describe --always || echo "v0.0.0"
update_xml: true


filters:
- name: anything_in_Config
type: 'generic'
comment: 'Remove components with something in config'
keys: ["do not place", "DNP", 'bench_test']
exclude_config: true
exclude_value: true

variants:
- name: rotated
comment: 'A variant of the PCB with the components rotated like JLC likes it. See .kibot/jlcpcb_rotation_filter.yaml for rotations'
type: kibom
variant: rotated
pre_transform: apply_jlc_rotation

outputs:
- name: 'position'
comment: "Pick and place file, JLC style"
type: position
dir: release/hw-openmower-yardforce
options:
variant: rotated
output: '%f_cpl_jlc.%x'
format: CSV
units: millimeters
separate_files_for_front_and_back: false
only_smd: false
use_aux_axis_as_origin: false
columns:
- id: Ref
name: Designator
- Val
- Package
- id: PosX
name: "Mid X"
- id: PosY
name: "Mid Y"
- id: Rot
name: Rotation
- id: Side
name: Layer

- name: 'bom'
comment: "BoM with kibom"
type: kibom
dir: release/hw-openmower-yardforce
options:
format: CSV
number: 1
output: '%f_%i_jlc.%x'
conf:
ref_separator: ','
hide_pcb_info: true
columns:
- field: Value
name: Comment
- field: References
name: Designator
- Footprint
- field: JLC
name: 'LCSC Part #'

- name: JLCPCB_gerbers
comment: Gerbers compatible with JLCPCB
type: gerber
dir: release/hw-openmower-yardforce
options: &gerber_options
exclude_edge_layer: true
exclude_pads_from_silkscreen: true
plot_sheet_reference: false
plot_footprint_refs: true
plot_footprint_values: false
force_plot_invisible_refs_vals: false
tent_vias: true
use_protel_extensions: true
create_gerber_job_file: false
disable_aperture_macros: true
gerber_precision: 4.6
use_gerber_x2_attributes: false
use_gerber_net_attributes: false
line_width: 0.1
subtract_mask_from_silk: true
inner_extension_pattern: '.g%n'
layers:
- copper
- F.Silkscreen
- B.Silkscreen
- F.Mask
- B.Mask
- F.Paste
- B.Paste
- Edge.Cuts
- name: JLCPCB_drill
comment: Drill files compatible with JLCPCB
type: excellon
dir: release/hw-openmower-yardforce
options:
pth_and_npth_single_file: false
pth_id: '-PTH'
npth_id: '-NPTH'
metric_units: true
map: gerber
route_mode_for_oval_holes: false
output: "%f%i.%x"

- name: 'ibom'
comment: 'Generates an interactive web page useful to identify the position of the components in the PCB.'
type: 'ibom'
dir: 'release/hw-openmower-yardforce'
options:
dnf_filter: [anything_in_Config, _mechanical]
extra_fields: Stock_PN
highlight_pin1: true

- name: 'pdf_sch_print'
comment: 'Exports the PCB to the most common exchange format. Suitable for printing.'
type: 'pdf_sch_print'
dir: 'release/hw-openmower-yardforce'
options:
dnf_filter: anything_in_Config

- name: 'pcbdraw_svg'
comment: 'Exports the PCB as a 2D model (SVG, PNG or JPG).'
type: 'pcbdraw'
dir: 'release/hw-openmower-yardforce'
options:
format: 'svg'
dnf_filter: anything_in_Config

- name: 'pcbdraw_png'
comment: 'Exports the PCB as a 2D model (SVG, PNG or JPG).'
type: 'pcbdraw'
dir: 'release/hw-openmower-yardforce'
options:
format: 'png'
dnf_filter: anything_in_Config

- name: 'pcbdraw_svg_bottom'
comment: 'Exports the PCB as a 2D model (SVG, PNG or JPG).'
type: 'pcbdraw'
dir: 'release/hw-openmower-yardforce'
options:
bottom: true
format: 'svg'
dnf_filter: anything_in_Config

- name: 'pcbdraw_png_bottom'
comment: 'Exports the PCB as a 2D model (SVG, PNG or JPG).'
type: 'pcbdraw'
dir: 'release/hw-openmower-yardforce'
options:
bottom: true
format: 'png'
dnf_filter: anything_in_Config

- name: 'render_3d'
comment: "Exports the image generated by KiCad's 3D viewer."
type: 'render_3d'
dir: 'release/hw-openmower-yardforce'
options:
rotate_x: 1
rotate_y: 1
ray_tracing: false

- name: JLCPCB
comment: ZIP file for JLCPCB
type: compress
dir: release/hw-openmower-yardforce
options:
files:
- from_output: JLCPCB_gerbers
dest: release/hw-openmower-yardforce
- from_output: JLCPCB_drill
dest: release/hw-openmower-yardforce
72 changes: 72 additions & 0 deletions .kibot/jlcpcb_rotation_filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
filters:
- name: apply_jlc_rotation
comment: 'Adjust rotation for JLC'
type: rot_footprint
extend: false
invert_bottom: true
negative_bottom: false
rotations:
# Overwrite default, it's different for the selected one.
- ["CP_Elec_6.3x7.7", 0.0]
- ["^SOT-353_SC-70-5", -90.0]
- ["^Crystal_SMD_3225", 180.0]
- ["^QFN40P800X800X90",270.0]
# Default list from https://github.com/matthewlai/JLCKicadTools/blob/cc41212d5441ad7a75d98dbd30e77851ddaf4e5a/jlc_kicad_tools/cpl_rotations_db.csv
- ["^R_Array_Convex_",90.0]
- ["^R_Array_Concave_",90.0]
- ["^SOT-223",180.0]
- ["^SOT-23",180.0]
- ["^SOT-89",180.0]
- ["^TSOT-23",180.0]
- ["^SOT-353",180.0]
- ["^SOT-363",180.0]
- ["^QFN-",270.0]
- ["^LQFP-",270.0]
- ["^TQFP-",270.0]
- ["^SOP-4_",0.0]
- ["^SOP-(?!18_)",270.0]
- ["^TSSOP-",270.0]
- ["^SSOP-",270.0]
- ["^DFN-",270.0]
- ["^SOIC-",270.0]
- ["^SOP-18_",0.0]
- ["^VSSOP-8_3.0x3.0mm_P0.65mm",270.0]
- ["^VSSOP-8_",180.0]
- ["^VSSOP-10_",270.0]
- ["^VSON-8_",270.0]
- ["^TSOP-6",270.0]
- ["^UDFN-10",270.0]
- ["^USON-10",270.0]
- ["^TDSON-8-1",270.0]
- ["^CP_EIA-",180.0]
- ["^CP_Elec_8x5.4",180.0]
- ["^CP_Elec_8x10.5",180.0]
- ["^CP_Elec_6.3x7.7",180.0]
- ["^CP_Elec_8x6.7",180.0]
- ["^CP_Elec_8x10",180.0]
- ["^CP_Elec_10x10",180.0]
- ["^(.*?_|V)?QFN-(16|20|24|28|40)(-|_|$)",270.0]
- ["^Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumbering",90.0]
- ["^PowerPAK_SO-8_Single",270.0]
- ["^HTSSOP-28-1EP_4.4x9.7mm*",270.0]
- ["^PUIAudio_SMT_0825_S_4_R*",270.0]
- ["^USB_C_Receptacle_HRO_TYPE-C-31-M-12*",180.0]
- ["^ESP32-W",270.0]
- ["^SOIC127P798X216-8N",-90.0]
- ["^SW_DIP_SPSTx01_Slide_Copal_CHS-01B_W7.62mm_P1.27mm",-180.0]
- ["^BatteryHolder_Keystone_1060_1x2032",-180.0]
- ["^SO-14",-90.0]
- ["^HTSSOP-",270.0]
- ["^Relay_DPDT_Omron_G6K-2F-Y",270.0]
- ["^RP2040-QFN-56",270.0]
- ["^TO-277",90.0]
- ["^SW_SPST_B3",90.0]
- ["^Transformer_Ethernet_Pulse_HX0068ANL",270.0]
- ["^JST_GH_SM",180.0]
- ["^JST_PH_S",180.0]
- ["^Diodes_PowerDI3333-8",270.0]
- ["^Quectel_L80-R",270.0]
- ["^SC-74-6",180.0]
- ["^SOT-143",180.0]
# we need this one in order to invert bottom rotations. I'd argue it's a bug in kibot
- [".*", 0.0]
Loading

0 comments on commit a1edc7c

Please sign in to comment.