From 1e252e0e5ff78db53ef4fccdc8bff2540c34c5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Tue, 31 Dec 2024 16:45:04 -0500 Subject: [PATCH] ci(update): extracting twilight semver from release name --- .github/update.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/update.sh b/.github/update.sh index cd355b0..a66a4e2 100755 --- a/.github/update.sh +++ b/.github/update.sh @@ -13,6 +13,13 @@ fi repo_tags=$(curl 'https://api.github.com/repos/zen-browser/desktop/tags' -s) twilight_tag=$(echo "$repo_tags" | jq -r '.[]|select(.name|test("twilight"))') + +twilight_version_name=$(curl 'https://api.github.com/repos/zen-browser/desktop/releases/tags/twilight' -s | jq -r '.name' | grep -oE '([0-9\.])+-t.[0-9]+') +if [ "$twilight_version_name" = "" ]; then + echo "No twilight version could be extracted..." + exit 1 +fi + beta_tag=$(echo "$repo_tags" | jq -r '(map(select(.name | test("-b.")))) | first') commit_beta_targets="" @@ -48,7 +55,12 @@ try_to_update() { prefetch_output=$(nix store prefetch-file --unpack --hash-type sha256 --json "$download_url") sha256=$(echo "$prefetch_output" | jq -r '.hash') - jq ".[\"$name\"][\"$arch-linux\"] = {\"name\":\"$name\",\"version\":\"$version\",\"sha1\":\"$remote_sha1\",\"url\":\"$download_url\",\"sha256\":\"$sha256\"}" sources.json.tmp + semver=$version + if [ "$name" = "twilight" ]; then + semver="$twilight_version_name" + fi + + jq ".[\"$name\"][\"$arch-linux\"] = {\"name\":\"$name\",\"version\":\"$semver\",\"sha1\":\"$remote_sha1\",\"url\":\"$download_url\",\"sha256\":\"$sha256\"}" sources.json.tmp mv sources.json.tmp sources.json echo "$name was updated to $version" # missing nix build! @@ -69,7 +81,7 @@ try_to_update() { if [ "$name" = "twilight" ]; then if [ "$commit_twilight_targets" = "" ]; then commit_twilight_targets="$arch" - commit_twilight_version="latest" + commit_twilight_version="$twilight_version_name" else commit_twilight_targets="$commit_twilight_targets && $arch" fi