mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-04-15 22:26:25 +02:00
docs: rework versioning to keep latest feature version per major (#223)
This commit is contained in:
17
.github/workflows/docs.yml
vendored
17
.github/workflows/docs.yml
vendored
@@ -34,26 +34,17 @@ jobs:
|
||||
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||
DEPLOY_VERSION="v$(echo "$VERSION" | cut -d. -f1-2)"
|
||||
|
||||
# On new major: consolidate previous major's feature versions into vX
|
||||
# On new major: keep only the latest feature version of the previous major
|
||||
PREV_MAJOR=$((MAJOR - 1))
|
||||
OLD_FEATURE_VERSIONS=$(uv run mike list 2>/dev/null | grep -oE "^v${PREV_MAJOR}\.[0-9]+" || true)
|
||||
|
||||
if [ -n "$OLD_FEATURE_VERSIONS" ]; then
|
||||
LATEST_PREV_TAG=$(git tag -l "v${PREV_MAJOR}.*" | sort -V | tail -1)
|
||||
|
||||
if [ -n "$LATEST_PREV_TAG" ]; then
|
||||
git checkout "$LATEST_PREV_TAG" -- docs/ docs_src/ src/ zensical.toml
|
||||
if ! grep -q '\[project\.extra\.version\]' zensical.toml; then
|
||||
printf '\n[project.extra.version]\nprovider = "mike"\ndefault = "stable"\nalias = true\n' >> zensical.toml
|
||||
fi
|
||||
uv run mike deploy "v${PREV_MAJOR}"
|
||||
git checkout HEAD -- docs/ docs_src/ src/ zensical.toml
|
||||
fi
|
||||
|
||||
# Delete old feature versions
|
||||
LATEST_PREV=$(echo "$OLD_FEATURE_VERSIONS" | sort -t. -k2 -n | tail -1)
|
||||
echo "$OLD_FEATURE_VERSIONS" | while read -r OLD_V; do
|
||||
if [ "$OLD_V" != "$LATEST_PREV" ]; then
|
||||
echo "Deleting $OLD_V"
|
||||
uv run mike delete "$OLD_V"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
site_name = "FastAPI Toolsets"
|
||||
site_description = "Production-ready utilities for FastAPI applications."
|
||||
site_author = "d3vyce"
|
||||
site_url = "https://fastapi-toolsets.d3vyce.fr"
|
||||
site_url = "https://fastapi-toolsets.d3vyce.fr/"
|
||||
copyright = "Copyright © 2026 d3vyce"
|
||||
repo_url = "https://github.com/d3vyce/fastapi-toolsets"
|
||||
|
||||
[project.extra.version]
|
||||
provider = "mike"
|
||||
default = "stable"
|
||||
alias = true
|
||||
|
||||
[project.theme]
|
||||
custom_dir = "docs/overrides"
|
||||
language = "en"
|
||||
|
||||
Reference in New Issue
Block a user