2020-11-06 00:17:08 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PACKAGES_FOLDER_NAME="packages"
|
|
|
|
PACKAGE_FILE_NAME="SummerCart64_PCB"
|
|
|
|
FILES=(
|
2021-02-01 00:40:56 +01:00
|
|
|
"./hw/v1/CAMOutputs"
|
2020-11-06 00:17:08 +01:00
|
|
|
# Manually created files
|
2021-02-01 00:40:56 +01:00
|
|
|
"./hw/v1/SummerCart64_sch.pdf"
|
|
|
|
"./hw/v1/SummerCart64_brd_top.pdf"
|
|
|
|
"./hw/v1/SummerCart64_brd_bot.pdf"
|
|
|
|
"./hw/v1/SummerCart64_brd_place_top.pdf"
|
2020-11-06 00:17:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Add version to zip file name if provided
|
|
|
|
if [[ $1 ]]; then
|
|
|
|
PACKAGE_FILE_NAME="${PACKAGE_FILE_NAME}-${1}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Generate Gerbers
|
2021-02-01 00:40:56 +01:00
|
|
|
pushd hw/v1
|
2020-11-06 00:17:08 +01:00
|
|
|
if [[ -e CAMOutputs ]]; then
|
|
|
|
rm -rf CAMOutputs
|
|
|
|
fi
|
|
|
|
echo "Generating Gerbers"
|
|
|
|
eaglecon.exe -X -dCAMJOB -jSummerCart64.cam SummerCart64.brd
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
# Create packages directory
|
|
|
|
echo "Creating ${PACKAGES_FOLDER_NAME} directory"
|
|
|
|
mkdir -p "${PACKAGES_FOLDER_NAME}"
|
|
|
|
|
|
|
|
|
|
|
|
# ZIP files for release
|
|
|
|
echo "Zipping PCB files"
|
|
|
|
if [[ -e "${PACKAGES_FOLDER_NAME}/${PACKAGE_FILE_NAME}.zip" ]]; then
|
|
|
|
rm -f "${PACKAGES_FOLDER_NAME}/${PACKAGE_FILE_NAME}.zip"
|
|
|
|
fi
|
|
|
|
zip -r "${PACKAGES_FOLDER_NAME}/${PACKAGE_FILE_NAME}.zip" ${FILES[@]}
|