From e84c329a30bb65597d11ba5a244ab9d2aec0e0fa Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 3 Sep 2024 23:05:33 +0900 Subject: [PATCH] Relax jq version requirement to 1.3 --- .github/.cspell/project-dictionary.txt | 1 - .github/workflows/ci.yml | 20 ++------------------ CHANGELOG.md | 2 ++ README.md | 4 ++-- main.sh | 6 +++--- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/.github/.cspell/project-dictionary.txt b/.github/.cspell/project-dictionary.txt index 25319e97..04d10ca4 100644 --- a/.github/.cspell/project-dictionary.txt +++ b/.github/.cspell/project-dictionary.txt @@ -22,7 +22,6 @@ nextest pluginconf protoc pwsh -QQSTRING quickinstall rclone rdme diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f78503a..68401528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,18 +147,7 @@ jobs: timeout-minutes: 60 container: ${{ matrix.container }} steps: - - name: Install requirements (ubuntu:14.04) - run: | - set -CeEuxo pipefail - # ubuntu 14.04's jq is 1.3 - # error: syntax error, unexpected QQSTRING_START, expecting $end - # https://github.com/jqlang/jq/issues/273 - apt-get -o Acquire::Retries=10 -qq update - apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends ca-certificates curl - curl --proto '=https' --tlsv1.2 -fsSL --retry 10 -o /usr/local/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64 - chmod +x /usr/local/bin/jq - if: startsWith(matrix.container, 'ubuntu:14.04') - - name: Install requirements (debian:9) + - name: Install requirements (old debian) run: | set -CeEuxo pipefail # In Debian, the old repositories is removed from the main mirrors some time after EoL. @@ -182,12 +171,7 @@ jobs: ./configure --prefix=/usr/local --with-ssl make make install - # CentOS 6's jq is 1.3 - # error: syntax error, unexpected QQSTRING_START, expecting $end - # https://github.com/jqlang/jq/issues/273 - curl --proto '=https' --tlsv1.2 -fsSL --retry 10 -o /usr/local/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64 - chmod +x /usr/local/bin/jq - # for checkout-action https://github.com/taiki-e/checkout-action/blob/87380fc33ed8e04e325b05d3576995b2253ab5ba/.github/workflows/ci.yml#L134-L142 + # for checkout-action https://github.com/taiki-e/checkout-action/blob/v1.3.0/.github/workflows/ci.yml#L135-L143 yum install -y openssh-clients perl perl-Error perl-TermReadKey rsync rpm -i \ https://vault.ius.io/el6/x86_64/packages/p/perl-Git18-1.8.5.5-4.ius.el6.noarch.rpm \ diff --git a/CHANGELOG.md b/CHANGELOG.md index c4a92364..a3da434d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com - Update `typos@latest` to 1.24.3. +- Relax jq version requirement for containers and self-hosted runners to 1.3 (no longer need to install the newer version of jq when using this action on Ubuntu 14.04/CentOS 6). + ## [2.42.37] - 2024-08-30 - Update `cargo-make@latest` to 0.37.16. diff --git a/README.md b/README.md index 6489183e..cf8544d4 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,10 @@ On Linux, if any required tools are missing, this action will attempt to install On other platforms, at least the following tools are required: - bash 3.2+ -- jq 1.5+ +- jq 1.3+ - curl 7.34+ (or RHEL7/CentOS7's patched curl 7.29) -Known environments affected by the above version requirements are CentOS 6 (EoL on 2020-11) using curl 7.19 and jq 1.3, and Ubuntu 14.04 (EoL on 2019-04) using jq 1.3 (see "Install requirements" in [our CI config](https://github.com/taiki-e/install-action/blob/HEAD/.github/workflows/ci.yml) for example of workaround). +Known environments affected by the above version requirements are CentOS 6 (EoL on 2020-11) using curl 7.19, and Ubuntu 12.04 (EoL on 2017-04) using curl 7.22 (see "Install requirements" in [our CI config](https://github.com/taiki-e/install-action/blob/HEAD/.github/workflows/ci.yml) for example of workaround). ## Related Projects diff --git a/main.sh b/main.sh index 7c236acc..07bc76c6 100755 --- a/main.sh +++ b/main.sh @@ -187,7 +187,7 @@ read_manifest() { local version="$2" local manifest rust_crate=$(call_jq -r ".rust_crate" "${manifest_dir}/${tool}.json") - manifest=$(call_jq -r ".\"${version}\"" "${manifest_dir}/${tool}.json") + manifest=$(call_jq -r ".[\"${version}\"]" "${manifest_dir}/${tool}.json") if [[ "${manifest}" == "null" ]]; then download_info="null" return 0 @@ -196,7 +196,7 @@ read_manifest() { if [[ "${exact_version}" == "null" ]]; then exact_version="${version}" else - manifest=$(call_jq -r ".\"${exact_version}\"" "${manifest_dir}/${tool}.json") + manifest=$(call_jq -r ".[\"${exact_version}\"]" "${manifest_dir}/${tool}.json") if [[ "${rust_crate}" != "null" ]]; then # TODO: don't hardcode tool name and use 'immediate_yank_reflection' field in base manifest. case "${tool}" in @@ -213,7 +213,7 @@ read_manifest() { fi info "${tool}@${exact_version} is yanked; downgrade to ${previous_stable_version}" exact_version="${previous_stable_version}" - manifest=$(jq -r ".\"${exact_version}\"" "${manifest_dir}/${tool}.json") + manifest=$(jq -r ".[\"${exact_version}\"]" "${manifest_dir}/${tool}.json") done ;; esac