Commit Graph

274 Commits

Author SHA1 Message Date
Tim Hadwen
6a411cdc3f Use submodule path for upload-bom.sh instead of raw URL
PCB projects already check out kicad-ci as a .gitlab submodule
(GIT_SUBMODULE_STRATEGY: recursive). Using the local path keeps
the script version pinned to the submodule pointer + removes the
need for the kicad9 ref hardcoded in the curl URL.
2026-05-24 09:57:39 +00:00
Tim Hadwen
bd7882f54f Switch CI BOM upload from InvenTree (hfsntree) to Astable
Replaces the `inventree_dev` + `inventree_main` jobs with
`astable_dev` + `astable_main` calling `POST /api/v1/bom/upload`
on the Astable instance. The old hfsntree path is removed —
Astable is now the source of truth for BOMs, and owns the
supplier-API credentials (Digi-Key / Mouser / etc.) so the CI
runner doesn't need them any more.

Revision targeting matches the previous convention:
- dev branch: uploads to the DRAFT "dev" rev
- main branch: uploads to the rev named from commit message,
  promoted to ACTIVE
- MR-to-main: uploads to dev (matches old hfsntree behaviour)

Strict mode: any MPN that can't be resolved against an enabled
supplier integration aborts the whole upload — no orphan parts
get created when a CSV ships with typos.

Files uploaded alongside the BOM CSV (each optional, skipped
when absent so dev and main share the same template):

  gerbers, panel gerbers, STEP, schematic PDF, PCB layout PDF,
  iBOM HTML, BOM xlsx, PCBA + bare-PCB renders, DRC + ERC
  reports, CPL CSV.

Astable attaches each file to the PCBA part, the bare PCB part,
or both (per fab-file dispatch table). Files attached to both
parts dedupe storage via content-addressed paths.

Required CI variables (set group-level on
Micromelon/education/hardware/, masked + protected):

  ASTABLE_URL         e.g. https://astable.timhadwen.com
  ASTABLE_API_TOKEN   minted at /manage/api-tokens (ast_…)

scripts/upload-bom.sh vendored from the Astable repo
(scripts/ci/upload-bom.sh) — the .astable_base before_script
curls a copy from this repo's raw URL at job time so the include:
project: pattern stays self-contained.

Downstream `upload_packages` needs: updated from inventree_main
→ astable_main.
2026-05-24 09:54:02 +00:00
Tim Hadwen
a9b5e1fa07 Add BOM group_fields for MPN and deactivate-old CI step
- Add group_fields: [Value, Footprint, mpn] to all BOM outputs to prevent
  components with different MPNs from being merged into one row
- Add deactivate-old step to inventree_main release pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 17:38:52 +10:00
Tim Hadwen
f54fb00f57 Add name text variable and enable panel jobs on dev
- Added 'name' text variable to pcb_main, sch, mech, pos kibot configs
- Removed main_rules restriction from generate_gerbers, generate_position, generate_panel
- Updated inventree_dev to depend on gerbers, position, panel jobs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:45:40 +10:00
Tim Hadwen
7abd4621a9 Fix YAML syntax in create_release job
Simplified release job - removed complex asset links that caused YAML error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:27:05 +10:00
Tim Hadwen
e5c5746b2c Fix version extraction: dev branch uses 'dev', main extracts from commit
- dev branch: always VERSION="dev"
- main branch: extract version from commit message (e.g., "V1.2")
- Add KIBOT_VAR_name to all kibot script sections
- Add asset link to release

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:12:57 +10:00
Tim Hadwen
3778a453e8 Simplify release to single zip with all fabrication outputs
Creates ${PROJECT_NAME}_${VERSION}.zip containing all gerbers,
BOMs, images, placement files, 3D models, etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:22:53 +10:00
Tim Hadwen
6894ca56c7 Add KIBOT_VAR_name to fabrication jobs
Ensures part number text variable is set correctly on silkscreen.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:16:06 +10:00
Tim Hadwen
366165ceb6 Fix version detection to use KIBOT_VAR_rev environment variable
Updated sch, mech, pcb_main, and pos configs to properly check
for KIBOT_VAR_rev before falling back to git describe.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:59:45 +10:00
Tim Hadwen
5e3e00c8c1 Restore pre_panel.py with origin mark features
Reverts to version with:
- Origin marks (copper squares + silkscreen circles)
- Proper JSON parsing with .get() defaults
- JSON-based scriptarg format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:48:44 +10:00
Tim Hadwen
5ac89f2df3 Fix InvenTree uploads to use dev revision for MRs
- Dev branch commits: upload to "dev" revision (was dry-run)
- MRs targeting main: upload to "dev" revision (was actual version)
- Actual main commits: upload to versioned revision

This allows pre-ordering parts during development while preventing
accidental version uploads until code is actually merged.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:30:23 +10:00
timmyhadwen
78fa1c0652 Simplify create_release to use native GitLab release keyword 2026-01-17 20:10:30 +10:00
timmyhadwen
9b4e101400 Fix upload_packages: Python one-liner to avoid YAML issues 2026-01-17 15:17:02 +10:00
timmyhadwen
2b717d1795 Fix YAML syntax for Python heredoc 2026-01-17 15:16:14 +10:00
timmyhadwen
0dc6ff725f Fix upload_packages: use Python urllib (no curl/wget in image) 2026-01-17 15:15:36 +10:00
timmyhadwen
1975291cea Fix upload_packages: use pre-installed curl 2026-01-17 14:58:16 +10:00
timmyhadwen
e530a3768b Fix upload_packages: use wget instead of curl (dependency conflict) 2026-01-17 14:38:16 +10:00
timmyhadwen
614b566d31 Add complete KiCad CI pipeline with hfsntree integration
Pipeline stages:
- preflight: extract_version, run_erc, run_drc
- fabrication: schematic, BOM, 3D, gerbers, position, panel
- inventree: dry-run on dev, full upload on main
- release: package upload and GitLab release

Features:
- Version extraction from MR title (V1.0, V1.1, etc.)
- Version injection into KiBot outputs
- Samsung P&P file generation
- Panel gerber generation

Usage: Include this file in project CI and set PROJECT_NAME variable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:23:05 +10:00
timmyhadwen
1cae44ffdc Add env var fallback for KiBot text variables
- rev/rev_pcb: Use KIBOT_VAR_rev if set, else git describe
- name: Use KIBOT_VAR_name if set, else extract from filename

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 23:24:13 +10:00
timmyhadwen
8f5ce0453f none 2025-09-07 19:03:41 +10:00
timmyhadwen
6440716d3b rename 2025-09-07 17:25:22 +10:00
timmyhadwen
c3b5ada5d8 WIP 2025-09-07 17:14:32 +10:00
timmyhadwen
a9ca11b8b8 Bump down to 1.8.3 2025-09-07 15:06:43 +10:00
timmyhadwen
05edda8948 updated 2025-09-07 13:21:44 +10:00
timmyhadwen
35543959fa Updated prepanel script 2025-09-07 12:39:14 +10:00
timmyhadwen
d60d8d81b3 Swapped step for export_3d as per warning 2025-09-06 18:09:06 +10:00
Tim Hadwen
220e70082f Merged main into kicad9 2025-08-31 17:40:03 +10:00
andrewc
c3aa9c6b28 FIX: variant handling, kintree cli syntax, and PCB image handling 2025-07-29 12:05:52 +10:00
andrewc
f916bbead6 Generate PCBA image, and fixup uploads of images to inventree 2025-07-29 10:42:57 +10:00
andrewc
218ec0f190 Parse the pcb name properly for use as the IPN 2025-07-29 10:04:16 +10:00
andrewc
5e5b456072 Change kintree_cli flags to match new syntax 2025-07-28 10:08:24 +10:00
andrewc
6b1e4b44c4 Fix up naming and parsing of files with variants 2025-07-25 15:36:42 +10:00
andrewc
e9f401a204 Kibot variants were not working with groups as expected, so config
structure has been changed to not use groups
2025-07-25 10:33:17 +10:00
andrewc
82611b2951 FIX: fix path to template schematic for post panel scripting 2025-07-22 14:25:58 +10:00
andrewc
c18b69520d FIX: fix path to template schematic for post panel scripting 2025-07-22 14:25:02 +10:00
ac
664fc82490 FIX: Author initials parsing 2025-07-21 16:45:56 +10:00
ac
908120fc75 FIX: Author initials parsing 2025-07-21 16:45:24 +10:00
ac
a0789f749b FIX: tag parsing in release job 2025-07-21 16:19:14 +10:00
ac
f139e49ff7 FIX: tag parsing in release job 2025-07-21 16:17:36 +10:00
ac
85ae8ad7e2 FIX: tag parsing 2025-07-21 16:02:17 +10:00
ac
27cc645aed FIX: tag parsing 2025-07-21 16:01:33 +10:00
andrewc
6b48805dfb FIX: update gitignore to ignore kicad locks 2025-07-17 11:46:18 +10:00
andrewc
a9abc89dcf FIX: update gitignore to ignore kicad locks 2025-07-17 11:45:19 +10:00
andrewc
1df81db282 FIX: cut down bash function in release job so it doesn't complain about syntax errors. 2025-07-16 12:17:57 +10:00
andrewc
e803315a12 FIX: cut down bash function in release job so it doesn't complain about
syntax errors.
2025-07-16 12:14:58 +10:00
andrewc
cb37408d17 Merge branch 'main' into dev 2025-07-16 12:10:10 +10:00
andrewc
61b08496bd FEAT: added standardised text to panels to help with pnp 2025-07-02 14:04:49 +10:00
andrewc
340c6a78d1 Merge branch 'panel_info' into dev 2025-07-02 14:03:15 +10:00
andrewc
40125098dd FIX: correct file extension in foot_gen script 2025-07-02 14:01:51 +10:00
andrewc
afa1ed40a5 Fix incorrect file reference in foot_gen script 2025-07-02 13:59:59 +10:00