add release script

This commit is contained in:
Brendan Haines 2022-10-30 13:39:04 -06:00
parent d224f6ac7f
commit f3b49c39a6

26
release.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
# Usage:
# 1. increment version, commit, and tag with bump2version
# 2. generate production outputs from within pcbnew using the "Fabrication Toolkit" action plugin (https://github.com/Bouni/kicad-jlcpcb-tools)
# 3. run this script to move, rename, and commit production outputs
set -e
mkdir -p releases
TAG=v$(bump2version --dry-run --list minor | grep current_version | sed -r s,"^.*=",,)
PROJ=mellifera
SRC="${PROJ}/production"
DEST="releases/${TAG}"
mkdir $DEST
mv $SRC/bom.csv $DEST/${PROJ}_bom_${TAG}.csv
mv $SRC/designators.csv $DEST/${PROJ}_designators_${TAG}.csv
mv $SRC/gerber.zip $DEST/${PROJ}_gerber_${TAG}.zip
mv $SRC/netlist.ipc $DEST/${PROJ}_netlist_${TAG}.ipc
mv $SRC/positions.csv $DEST/${PROJ}_positions_${TAG}.csv
rmdir $SRC
git add $DEST
git commit -o $DEST -m "Generate ${TAG} production outputs"