From 724f9d61a3f716ff19c4fba90c0a927dbb12dc9b Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 27 Feb 2023 13:13:34 +0100 Subject: [PATCH] tools: create llhttp update action PR-URL: https://github.com/nodejs/node/pull/46766 Reviewed-By: Paolo Insogna Reviewed-By: Rafael Gonzaga --- .github/workflows/tools.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index e92a2e787a7b91..eb10935828722f 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -164,6 +164,19 @@ jobs: echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV ./tools/update-nghttp2.sh "$NEW_VERSION" fi + - id: llhttp + subsystem: deps + label: dependencies + run: | + NEW_VERSION=$(gh api repos/nodejs/llhttp/releases/latest -q '.tag_name|ltrimstr("release/v")') + CURRENT_MAJOR_VERSION=$(grep "#define LLHTTP_VERSION_MAJOR" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*MAJOR \(.*\)/\1/p") + CURRENT_MINOR_VERSION=$(grep "#define LLHTTP_VERSION_MINOR" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*MINOR \(.*\)/\1/p") + CURRENT_PATCH_VERSION=$(grep "#define LLHTTP_VERSION_PATCH" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*PATCH \(.*\)/\1/p") + CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION" + if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + ./tools/update-llhttp.sh "$NEW_VERSION" + fi steps: - uses: actions/checkout@v3 with: