diff --git a/tools/dep_updaters/update-c-ares.sh b/tools/dep_updaters/update-c-ares.sh index bf20f5b25f9c7d..66d37ba350c246 100755 --- a/tools/dep_updaters/update-c-ares.sh +++ b/tools/dep_updaters/update-c-ares.sh @@ -11,7 +11,7 @@ DEPS_DIR="$BASE_DIR/deps" # shellcheck disable=SC1091 . "$BASE_DIR/tools/dep_updaters/utils.sh" -NEW_VERSION="$("$NODE" --input-type=module <<'EOF' +NEW_VERSION_METADATA="$("$NODE" --input-type=module <<'EOF' const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/latest', process.env.GITHUB_TOKEN && { headers: { @@ -19,11 +19,17 @@ const res = await fetch('https://api.github.com/repos/c-ares/c-ares/releases/lat }, }); if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); -const { tag_name } = await res.json(); -console.log(tag_name.replace('cares-', '').replaceAll('_', '.')); +const { tag_name, assets } = await res.json(); +const { browser_download_url, name } = assets.find(({ name }) => name.endsWith('.tar.gz')); +if(!browser_download_url || !name) throw new Error('No tarball found'); +console.log(`${tag_name} ${browser_download_url} ${name}`); EOF )" +IFS=' ' read -r NEW_VERSION NEW_VERSION_URL ARES_TARBALL <