Skip to content

Commit

Permalink
fix: correct version check
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Jan 7, 2025
1 parent 7dd27fa commit 27fd861
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
26 changes: 13 additions & 13 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ cp i18n/zh/docusaurus-plugin-content-docs/current.json i18n/zh/docusaurus-plugin
jq 'del(.["version.label"])' version-$VERSION.json > temp.json && mv temp.json version-$VERSION.json

echo "Removing greptimecloud content from current version"
CURRENT_VERSION=$(ls -1 versioned_docs | sort | head -n 1)
rm -rf versioned_docs/$CURRENT_VERSION/greptimecloud
rm -rf i18n/zh/docusaurus-plugin-content-docs/$CURRENT_VERSION/greptimecloud
jq 'del(.docs[] | select(.label == "GreptimeCloud"))' versioned_sidebars/$CURRENT_VERSION-sidebars.json > temp.json && mv temp.json versioned_sidebars/$CURRENT_VERSION-sidebars.json
sed -i '/^- \[GreptimeCloud\]/d' versioned_docs/$CURRENT_VERSION/index.md
sed -i '/^- \[GreptimeCloud\]/d' i18n/zh/docusaurus-plugin-content-docs/$CURRENT_VERSION/index.md
CURRENT_VERSION=$(jq -r '.[0]' versions.json)
rm -rf versioned_docs/version-$CURRENT_VERSION/greptimecloud
rm -rf i18n/zh/docusaurus-plugin-content-docs/version-$CURRENT_VERSION/greptimecloud
jq 'del(.docs[] | select(.label == "GreptimeCloud"))' versioned_sidebars/version-$CURRENT_VERSION-sidebars.json > temp.json && mv temp.json versioned_sidebars/version-$CURRENT_VERSION-sidebars.json
sed -i '/^- \[GreptimeCloud\]/d' versioned_docs/version-$CURRENT_VERSION/index.md
sed -i '/^- \[GreptimeCloud\]/d' i18n/zh/docusaurus-plugin-content-docs/version-$CURRENT_VERSION/index.md

echo "Generating new version"
npm run docusaurus docs:version $VERSION

echo "Removing oldest version"
OLDEST_VERSION=$(ls -1 versioned_docs | sort -V | head -n 1)
rm -rf versioned_docs/$OLDEST_VERSION
rm -rf i18n/zh/docusaurus-plugin-content-docs/$OLDEST_VERSION/
rm i18n/zh/docusaurus-plugin-content-docs/$OLDEST_VERSION.json
rm versioned_sidebars/$OLDEST_VERSION-sidebars.json
OLDEST_VERSION=$(jq -r '.[-1]' versions.json)
rm -rf versioned_docs/version-$OLDEST_VERSION
rm -rf i18n/zh/docusaurus-plugin-content-docs/version-$OLDEST_VERSION/
rm i18n/zh/docusaurus-plugin-content-docs/version-$OLDEST_VERSION.json
rm versioned_sidebars/version-$OLDEST_VERSION-sidebars.json
jq '.[:-1]' versions.json > temp.json && mv temp.json versions.json

echo "Set new default"
npm run docusaurus docs:use-version $VERSION
# echo "Set new default"
# npm run docusaurus docs:use-version $VERSION
6 changes: 0 additions & 6 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ const config: Config = {
current: {
label: 'nightly',
path: 'nightly',
},
'0.8': {
path: 'v0.8'
},
'0.7': {
path: 'v0.7'
}
},
remarkPlugins: [
Expand Down

0 comments on commit 27fd861

Please sign in to comment.