beads/scripts/check-versions.sh
Chris Sells 52aea3f7e3 docs: go all-in on Mintlify — delete the Docusaurus site and its machinery
Per the decision record: no parallel run and no cutover PR. Removes
website/ (including the four versioned doc snapshots — current-only
versioning; snapshots remain in git history), deploy-docs.yml,
generate-llms-full.sh (Mintlify serves llms.txt natively), the ci-website
package gate (Makefile target, scripts/ci/website.sh, the package-website
jobs and their aggregate-gate entries in pr.yml/main.yml/release.yml, the
ci-measurements suite, detect-package-gates wiring), and the release-time
docs snapshot flow (snapshot-release-docs.sh, check-docs-version.sh, their
call sites in update-versions.sh/check-versions.sh, RELEASING.md section
rewritten for the Mintlify reality).

Drift machinery now covers exactly the Mintlify artifacts:
check-cli-docs-drift.sh pathspecs/fingerprint, docs-autofix-push.sh
allowlist, and check-doc-flags.sh scans drop the website/llms paths. The
beads-docs skill's generated-content and verification sections updated to
the bd-generic + docsmint pipeline.

NOTE for merge time: if branch protection requires the 'Package Gate
(website)' check by name (rather than the aggregate gate), drop it from
the required checks or PRs will wait forever.

Gates: docsync PASS, generate-cli-docs.sh --check PASS, freshness PASS.
2026-07-12 10:37:17 -07:00

79 lines
2.3 KiB
Bash
Executable file

#!/bin/bash
# Check that all version files are in sync
# Run this before committing version bumps
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
# Get the canonical version from version.go
CANONICAL=$(grep 'Version = ' cmd/bd/version.go | sed 's/.*"\(.*\)".*/\1/')
if [ -z "$CANONICAL" ]; then
echo -e "${RED}❌ Could not read version from cmd/bd/version.go${NC}"
exit 1
fi
echo "Canonical version (from version.go): $CANONICAL"
echo ""
MISMATCH=0
check_version() {
local _file=$1
local version=$2
local description=$3
if [ "$version" != "$CANONICAL" ]; then
echo -e "${RED}❌ $description: $version (expected $CANONICAL)${NC}"
MISMATCH=1
else
echo -e "${GREEN}✓ $description: $version${NC}"
fi
}
# Check all version files
check_version "integrations/beads-mcp/pyproject.toml" \
"$(grep '^version = ' integrations/beads-mcp/pyproject.toml 2>/dev/null | sed 's/.*"\(.*\)".*/\1/')" \
"MCP pyproject.toml"
check_version "integrations/beads-mcp/src/beads_mcp/__init__.py" \
"$(grep '__version__ = ' integrations/beads-mcp/src/beads_mcp/__init__.py 2>/dev/null | sed 's/.*"\(.*\)".*/\1/')" \
"MCP __init__.py"
check_version "plugins/beads/.claude-plugin/plugin.json" \
"$(jq -r '.version' plugins/beads/.claude-plugin/plugin.json 2>/dev/null)" \
"Claude plugin.json"
check_version "plugins/beads/.codex-plugin/plugin.json" \
"$(jq -r '.version' plugins/beads/.codex-plugin/plugin.json 2>/dev/null)" \
"Codex plugin.json"
check_version ".claude-plugin/marketplace.json" \
"$(jq -r '.plugins[0].version' .claude-plugin/marketplace.json 2>/dev/null)" \
"Claude marketplace.json"
check_version "npm-package/package.json" \
"$(jq -r '.version' npm-package/package.json 2>/dev/null)" \
"npm package.json"
# Hook templates are now generated dynamically by cmd/bd/hooks.go using the
# Version constant from version.go, so no separate file check is needed.
# (Previously checked cmd/bd/templates/hooks/pre-commit which no longer exists.)
echo ""
echo ""
if [ $MISMATCH -eq 1 ]; then
echo -e "${RED}❌ Version mismatch detected!${NC}"
echo ""
echo "Run: scripts/update-versions.sh $CANONICAL"
echo "Or manually update the mismatched files."
exit 1
else
echo -e "${GREEN}✓ Version files and released-docs policy pass for: $CANONICAL${NC}"
fi