2020-11-06 00:17:08 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PACKAGES_FOLDER_NAME="packages"
|
|
|
|
PACKAGE_FILE_NAME="SummerCart64"
|
|
|
|
FILES=(
|
|
|
|
"./fw/output_files/SummerCart64.pof"
|
2021-02-06 19:53:20 +01:00
|
|
|
"./hw/v1/ftdi-template.xml"
|
2020-11-06 00:17:08 +01:00
|
|
|
"./sw/cic/UltraCIC-III.hex"
|
|
|
|
"./sw/cic/UltraCIC-III.eep.hex"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Add version to zip file name if provided
|
|
|
|
if [[ $1 ]]; then
|
|
|
|
PACKAGE_FILE_NAME="${PACKAGE_FILE_NAME}-${1}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Build bootloader
|
|
|
|
echo "Building bootloader"
|
|
|
|
pushd sw/bootloader
|
2021-02-06 19:35:50 +01:00
|
|
|
./build.sh
|
2020-11-06 00:17:08 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
# Build UltraCIC-III
|
|
|
|
pushd sw/cic
|
|
|
|
echo "Building UltraCIC-III"
|
|
|
|
avra UltraCIC-III.asm -D attiny45
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
# Build FPGA firmware
|
|
|
|
echo "Building FPGA firmware"
|
|
|
|
docker run -t --mount type=bind,src="$(pwd)",target="/build" chriz2600/quartus-lite:20.1.0 /usr/local/bin/quartus_wrapper quartus_sh --flow compile /build/fw/SummerCart64.qpf
|
|
|
|
|
|
|
|
|
|
|
|
# Create packages directory
|
|
|
|
echo "Creating ${PACKAGES_FOLDER_NAME} directory"
|
|
|
|
mkdir -p "${PACKAGES_FOLDER_NAME}"
|
|
|
|
|
|
|
|
|
|
|
|
# ZIP files for release
|
|
|
|
echo "Zipping 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[@]}
|