-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fetch latest (draft) release and unpack
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
main() { | ||
echo "Parsing the repo list" | ||
while IFS= read -r repo; do | ||
if release=$(curl -fqs -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${secrets.ARTIFACTS_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${repo}/releases); then | ||
echo $release | ||
tag="$(echo "$release" | jq -r '.[0].tag_name')" | ||
zip_files="$(echo "$release" | jq -r '.[0].assets[] | select(.name | endswith(".zip")) | .name')" | ||
echo "Parsing repo $repo at $tag" | ||
if [ -n "$zip_files" ]; then | ||
mkdir -p "firmware-$tag" | ||
pushd "firmware-$tag" >/dev/null | ||
while IFS= read -r zip_file || [[ -n $zip_file ]]; do | ||
echo "Getting ZIP ${zip_file}" | ||
wget -q "https://github.com/${repo}/releases/download/${tag}/${zip_file}" | ||
unzip -q "$zip_file" | ||
rm -f "$zip_file" | ||
done < <(printf '%s' "$zip_files") | ||
popd >/dev/null | ||
fi | ||
fi | ||
done <.github/config/package_list.txt | ||
} | ||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters