hrithik18k/open-ring-flex

A flexible wearable PCB integrating inductive battery charging, BLE control with SPI flash and 32 MHz crystal, SAM L10 capacitive touch/wear sensing, haptic MOSFET drive with a large capacitor bank, RF antenna matching, and SWD programming/test connectors.

Version
1.0.4
License
CC-BY-NC-SA-4.0
Stars
0

scripts/package-release.py

from pathlib import Path
import shutil,sys
root=Path(__file__).resolve().parent.parent
stage=root/'work'/(sys.argv[1] if len(sys.argv)>1 else 'publish-release')
stage.mkdir(parents=True,exist_ok=True)
for f in ['index.circuit.tsx','package.json','bun.lock','tsconfig.json','tscircuit.config.json','LICENSE','README.md']:
 shutil.copy2(root/f,stage/f)
for folder in ['imports','source-data','docs','scripts']:
 shutil.copytree(root/folder,stage/folder,dirs_exist_ok=True)
(stage/'dist/index').mkdir(parents=True,exist_ok=True)
for f in ['circuit.json','pcb.png','schematic.svg','schematic.png']:
 if (root/'dist/index'/f).exists():shutil.copy2(root/'dist/index'/f,stage/'dist/index'/f)
shutil.copytree(root/'dist/index/schematic-sheets',stage/'dist/index/schematic-sheets',dirs_exist_ok=True)
checks=stage/'docs/validation-logs';checks.mkdir(exist_ok=True)
for src,dest in [('build-release.log','build.log'),('netlist-release.log','netlist.log'),('schematic-release.log','schematic-placement.log'),('placement-release.log','placement.log'),('shorts-release.log','shorts.log'),('typecheck-direct.log','typecheck.log'),('schematic-revision.log','schematic-revision.log')]:
 shutil.copy2(root/'work'/src,checks/dest)
for src,dest in [('metadata-check.log','inductor-metadata.log'),('host-runtime-check.log','inductor-metadata-core-2202.log')]:
 shutil.copy2(root/'work/datasheet-fix'/src,checks/dest)
print('Clean package:',stage)
print('Files:',sum(p.is_file() for p in stage.rglob('*')))
print('Size:',sum(p.stat().st_size for p in stage.rglob('*') if p.is_file()))