Files
chrysalis-mirror/tools/firmware-update
2022-07-28 12:13:22 +02:00

36 lines
769 B
Bash
Executable File

#! /bin/sh
set -e
package_version() {
jq -r .version <package.json
}
URL_BASE="https://github.com/keyboardio/Chrysalis-Firmware-Bundle/releases"
TARBALL_FN="firmware-files.tar.gz"
case "$(package_version)" in
*-snapshot)
TAG="snapshot"
;;
*)
TAG="v$(package_version)"
;;
esac
URL="${URL_BASE}/download/${TAG}/${TARBALL_FN}"
wget -q -O - ${URL} | tar -C static -xzf -
git add static/**/default.{hex,bin} static/firmware-changelog.md static/build-info.yml
TMP=$(mktemp)
cat >${TMP} <<EOF
Update the firmware files we ship with
Artifacts downloaded from keyboardio/Chrysalis-Firmware-Bundle@${TAG}.
$(head -n 17 static/release-notes.md | tail -n +3)
EOF
git commit -s -F "${TMP}"
rm -f "${TMP}" static/release-notes.md