From ea9dcebef69a0d327d4057a0bcc28a4a6970bd04 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 2 Jun 2026 16:41:03 +0200 Subject: [PATCH] playground: show the grep build commit and date The playground version line records the coreutils WASM commit and the site commit, but grep (built as its own standalone WASM module) had no provenance shown. Capture grep's commit/short/date in the workflow and append a UUTILS_GREP_VERSION block to version.js, then render it next to "Built from uutils/coreutils ..." as "grep ()" linking to the uutils/grep commit. --- .github/workflows/website.yml | 13 +++++++++++++ content/playground.md | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index a25707e21..0f600de0b 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -212,6 +212,19 @@ jobs: else echo 'const WASM_COMMANDS = ["grep"];' > "$commands_js" fi + # Record the grep commit used to build its WASM module so the + # playground can show it alongside the coreutils build. + grep_hash=$(git rev-parse HEAD) + grep_short=$(git rev-parse --short HEAD) + grep_date=$(git show -s --format=%cI HEAD) + { + echo "const UUTILS_GREP_VERSION = {" + echo " commit: \"${grep_hash}\"," + echo " short: \"${grep_short}\"," + echo " date: \"${grep_date}\"" + echo "};" + } >> ../uutils.github.io/static/wasm/version.js + echo "grep WASM build: ${grep_short} (${grep_date})" fi - name: Run Zola diff --git a/content/playground.md b/content/playground.md index 2c2b74641..30e7f4325 100644 --- a/content/playground.md +++ b/content/playground.md @@ -55,6 +55,12 @@ template = "page.html" parts.push('Built from uutils/coreutils ' + UUTILS_WASM_VERSION.short + ' (' + date + ')'); } + if (typeof UUTILS_GREP_VERSION !== "undefined") { + var grepDate = UUTILS_GREP_VERSION.date.split("T")[0]; + var grepUrl = "https://github.com/uutils/grep/commit/" + UUTILS_GREP_VERSION.commit; + parts.push('grep ' + + UUTILS_GREP_VERSION.short + ' (' + grepDate + ')'); + } if (typeof SITE_VERSION !== "undefined") { var siteDate = SITE_VERSION.date.split("T")[0]; var siteUrl = "https://github.com/uutils/uutils.github.io/commit/" + SITE_VERSION.commit;