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 <short> (<date>)" linking to
the uutils/grep commit.
This commit is contained in:
Sylvestre Ledru
2026-06-02 16:41:03 +02:00
parent 77efde6da3
commit ea9dcebef6
2 changed files with 19 additions and 0 deletions
+13
View File
@@ -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
+6
View File
@@ -55,6 +55,12 @@ template = "page.html"
parts.push('Built from uutils/coreutils <a href="' + url + '"><code>' +
UUTILS_WASM_VERSION.short + '</code></a> (' + 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 <a href="' + grepUrl + '"><code>' +
UUTILS_GREP_VERSION.short + '</code></a> (' + 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;