Skip to content

Commit

Permalink
script to grab a firmware release and package it
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanperret committed Oct 25, 2024
1 parent 99e94d3 commit 3e42885
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions grab-fw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -euo pipefail

firmware_release=${1?}

filename=ayab-${firmware_release}.hex
filepath="src/main/resources/base/ayab/firmware/${filename}"

curl -Lo "$filepath" "https://github.com/jonathanperret/ayab-firmware/releases/download/${firmware_release}/ayab_monolithic_uno.hex"

git add -f "$filepath"

jsonpath=src/main/resources/base/ayab/firmware/firmware.json

current_json="$(cat "$jsonpath")"

echo "$current_json" |
jq --arg version "$firmware_release" --arg file "$filename" \
'.controller.uno += [{version: $version, file: $file}]' \
> "$jsonpath"

git add "$jsonpath"

git commit -m "Add firmware release ${firmware_release}"

0 comments on commit 3e42885

Please sign in to comment.