From 974934b72233695d95fc5708cff728f20d851dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Tue, 31 Dec 2024 14:57:20 -0500 Subject: [PATCH] feat: new script to automatically update beta and twilight versions --- new.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 new.sh diff --git a/new.sh b/new.sh new file mode 100644 index 0000000..5853627 --- /dev/null +++ b/new.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +repo_tags=$(curl 'https://api.github.com/repos/zen-browser/desktop/tags' -s) + +twilight_tag=$(echo "$repo_tags" | jq -r '.[]|select(.name|test("twilight"))') +beta_tag=$(echo "$repo_tags" | jq -r '(map(select(.name | test("-b.")))) | first') + +try_to_update() { + name=$1 + arch=$2 + target_tag_meta=$3 + + meta=$(jq ".[\"$name\"][\"$arch-linux\"]" sources.json.tmp + mv sources.json.tmp sources.json + + echo "$name was updated to $version" + fi +} + +set -e + +try_to_update "beta" "x86_64" "$beta_tag" +try_to_update "beta" "aarch64" "$beta_tag" +try_to_update "twilight" "x86_64" "$twilight_tag" +try_to_update "twilight" "aarch64" "$twilight_tag"