From e36e5a1f346d3d3f7f6dbc7f50bd98a6bf29962b Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 8 Apr 2024 14:34:21 +0100 Subject: [PATCH] chore(ci): fix cutting new versions of the docs --- docs/package.json | 2 +- docs/scripts/cut_version.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 docs/scripts/cut_version.sh diff --git a/docs/package.json b/docs/package.json index 4bbdf254c50..f9e95fc02f8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,7 +9,7 @@ "clean": "rm -rf ./processed-docs ./processed-docs ./build", "version::stables": "ts-node ./scripts/setStable.ts", "serve": "serve build", - "version": "yarn build && docusaurus docs:version" + "version": "yarn version::stables && ./scripts/cut_version.sh" }, "dependencies": { "@docusaurus/core": "^3.0.1", diff --git a/docs/scripts/cut_version.sh b/docs/scripts/cut_version.sh new file mode 100755 index 00000000000..4000707328c --- /dev/null +++ b/docs/scripts/cut_version.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -eu + +cd $(dirname "$0")/.. + +VERSION=$1 + +# We assume that the new release tag has been made on github, so setStable.ts will add this to `versions.json`. +# We don't have a version of the docs for this release however (that's what we're doing right now!) so we need to remove it. +jq 'map(select(. != "'"$VERSION"'"))' versions.json > tmp.json && mv tmp.json versions.json + +# We need to build the docs in order to perform all necessary preprocessing. +yarn build + +# Finally cut the actual new docs version. +yarn docusaurus docs:version $VERSION