Files
releases/docs/bin/build-latest.sh
T
Charlie Egan 1b7e7de85a website: Docs versioning (#8038)
Only revert the docs content to the latest release. Retain all other
parts of the site the same.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2025-11-10 17:41:26 +00:00

24 lines
565 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if ! git diff --quiet HEAD -- || ! git diff --cached --quiet; then
echo "Latest release build must be done without working changes"
git status
exit 1
fi
git fetch --tags origin
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
if [ -z "$LATEST_TAG" ]; then
echo "No valid release tag found (expected format: v1.2.3)"
exit 1
fi
# for docs content we use the latest release
git checkout "$LATEST_TAG" -- docs
BUILD_VERSION="$LATEST_TAG" npx docusaurus build