diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c6543e..c61a1e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ the API stability policy and migration guide before upgrading from `0.3.x`. ### Changed +- Add README health and support badges for CI, downstream consumers, PyPI, and supported Python versions. - Normalize command returns, Click errors, aborts, interrupts, `SystemExit`, and unexpected exceptions through one core outcome model and clean `run_app()` process boundary. diff --git a/README.md b/README.md index 83ccd49..ee258cd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # `base-cli` +[![Tests](https://img.shields.io/github/actions/workflow/status/basefoundry/base-cli/tests.yml?branch=main&label=tests)](https://github.com/basefoundry/base-cli/actions/workflows/tests.yml) +[![Reference consumers](https://img.shields.io/github/actions/workflow/status/basefoundry/base-cli/compatibility.yml?branch=main&label=consumers)](https://github.com/basefoundry/base-cli/actions/workflows/compatibility.yml) +[![PyPI](https://img.shields.io/pypi/v/base-cli.svg)](https://pypi.org/project/base-cli/) +[![Python](https://img.shields.io/pypi/pyversions/base-cli.svg)](https://pypi.org/project/base-cli/) + | Version | License | Install | Release notes | | --- | --- | --- | --- | | `0.4.0` | [Apache-2.0](LICENSE) | `python -m pip install base-cli` | [v0.4.0](https://github.com/basefoundry/base-cli/releases/tag/v0.4.0) | diff --git a/tests/validate.sh b/tests/validate.sh index a99f716..4f47194 100755 --- a/tests/validate.sh +++ b/tests/validate.sh @@ -43,7 +43,24 @@ for file in "${required_files[@]}"; do done version="$(head -n 1 VERSION | tr -d '\r')" -if ! sed -n '1,12p' README.md | tr -d '\r' | grep -F "| \`$version\` | [Apache-2.0](LICENSE) | \`python -m pip install base-cli\` | [v$version](https://github.com/basefoundry/base-cli/releases/tag/v$version) |" >/dev/null; then +readme_head="$(sed -n '1,18p' README.md | tr -d '\r')" +if ! printf '%s\n' "$readme_head" | grep -F "[![Tests](https://img.shields.io/github/actions/workflow/status/basefoundry/base-cli/tests.yml?branch=main&label=tests)](https://github.com/basefoundry/base-cli/actions/workflows/tests.yml)" >/dev/null; then + printf 'README.md is missing the main-branch tests health badge.\n' >&2 + exit 1 +fi +if ! printf '%s\n' "$readme_head" | grep -F "[![Reference consumers](https://img.shields.io/github/actions/workflow/status/basefoundry/base-cli/compatibility.yml?branch=main&label=consumers)](https://github.com/basefoundry/base-cli/actions/workflows/compatibility.yml)" >/dev/null; then + printf 'README.md is missing the reference-consumer health badge.\n' >&2 + exit 1 +fi +if ! printf '%s\n' "$readme_head" | grep -F "[![PyPI](https://img.shields.io/pypi/v/base-cli.svg)](https://pypi.org/project/base-cli/)" >/dev/null; then + printf 'README.md is missing the PyPI release badge.\n' >&2 + exit 1 +fi +if ! printf '%s\n' "$readme_head" | grep -F "[![Python](https://img.shields.io/pypi/pyversions/base-cli.svg)](https://pypi.org/project/base-cli/)" >/dev/null; then + printf 'README.md is missing the supported Python versions badge.\n' >&2 + exit 1 +fi +if ! printf '%s\n' "$readme_head" | grep -F "| \`$version\` | [Apache-2.0](LICENSE) | \`python -m pip install base-cli\` | [v$version](https://github.com/basefoundry/base-cli/releases/tag/v$version) |" >/dev/null; then printf 'README.md release strip does not match VERSION (%s), license, install command, and release link.\n' "$version" >&2 exit 1 fi