From cfb699eec519b163ab02bc92f42c2e9623521623 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 6 Sep 2025 10:41:51 +0200 Subject: [PATCH] Add helper scripts --- .github/workflows/update-versions.yml | 4 ++-- README.md | 18 +++++++++--------- .../generate_active_versions.php | 0 {bin => action-bin}/generate_qa-releases.php | 0 bin/fetch_latest_supported_version.sh | 7 +++++++ bin/fetch_lowest_supported_version.sh | 7 +++++++ bin/fetch_nightly_version.sh | 7 +++++++ 7 files changed, 32 insertions(+), 11 deletions(-) rename {bin => action-bin}/generate_active_versions.php (100%) rename {bin => action-bin}/generate_qa-releases.php (100%) create mode 100755 bin/fetch_latest_supported_version.sh create mode 100755 bin/fetch_lowest_supported_version.sh create mode 100755 bin/fetch_nightly_version.sh diff --git a/.github/workflows/update-versions.yml b/.github/workflows/update-versions.yml index 78b001a..a4c40bb 100644 --- a/.github/workflows/update-versions.yml +++ b/.github/workflows/update-versions.yml @@ -48,12 +48,12 @@ jobs: - name: "Update active versions file" run: | - php bin/generate_active_versions.php > actives.json + php action-bin/generate_active_versions.php > actives.json cat actives.json - name: "Update QA releases file" run: | - php bin/generate_qa-releases.php > qa-releases.json + php action-bin/generate_qa-releases.php > qa-releases.json cat qa-releases.json - name: "Add / commit / push" diff --git a/README.md b/README.md index 2be094f..d884743 100644 --- a/README.md +++ b/README.md @@ -24,16 +24,16 @@ Example with `7.4+` versions: > [!TIP] > -> - Find the **lowest** supported version: +> - Retrieve **lowest** supported version: > ```bash -> jq -r '(.[] | keys | sort) | first' actives.json -> # output: 7.4 +> bin/fetch_lowest_supported_version.sh > ``` -> - Find the **latest** supported version: +> Output: `7.4` +> - Retrieve **latest** supported version: > ```bash -> jq -r '(.[] | keys | sort) | last' actives.json -> # output: 8.1 +> bin/fetch_latest_supported_version.sh > ``` +> Output: `8.1` > ## QA releases @@ -80,11 +80,11 @@ Example with `8.5` version: > [!TIP] > -> In order to find the nightly version, you can use the following `jq` filter command: +> Retrieve **nightly** version: > ```bash -> jq -r 'last(.[] | .[] | select(.supported == false)) | .short_version' qa-releases.json -> # output: 8.5 +> bin/fetch_nightly_version.sh > ``` +> Output: `8.5` >
diff --git a/bin/generate_active_versions.php b/action-bin/generate_active_versions.php similarity index 100% rename from bin/generate_active_versions.php rename to action-bin/generate_active_versions.php diff --git a/bin/generate_qa-releases.php b/action-bin/generate_qa-releases.php similarity index 100% rename from bin/generate_qa-releases.php rename to action-bin/generate_qa-releases.php diff --git a/bin/fetch_latest_supported_version.sh b/bin/fetch_latest_supported_version.sh new file mode 100755 index 0000000..5e6f5a1 --- /dev/null +++ b/bin/fetch_latest_supported_version.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +set -eu + +SCRIPT_PATH=$(dirname "$0") + +jq -r '(.[] | keys | sort) | last' "${SCRIPT_PATH}/../actives.json" diff --git a/bin/fetch_lowest_supported_version.sh b/bin/fetch_lowest_supported_version.sh new file mode 100755 index 0000000..dad115e --- /dev/null +++ b/bin/fetch_lowest_supported_version.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +set -eu + +SCRIPT_PATH=$(dirname "$0") + +jq -r '(.[] | keys | sort) | first' "${SCRIPT_PATH}/../actives.json" diff --git a/bin/fetch_nightly_version.sh b/bin/fetch_nightly_version.sh new file mode 100755 index 0000000..9047fdf --- /dev/null +++ b/bin/fetch_nightly_version.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +set -eu + +SCRIPT_PATH=$(dirname "$0") + +jq -r 'last(.[] | .[] | select(.supported == false)) | .short_version' "${SCRIPT_PATH}/../qa-releases.json"