From bceb621a32f9b28675dacdd1a8644cf927856ade Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Sat, 13 Apr 2024 15:36:29 -0500 Subject: [PATCH] docs: Generate API documentation for release branch (#9081) --- jsdoc-conf.json | 2 +- release_docs.sh | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/jsdoc-conf.json b/jsdoc-conf.json index efbaa0a37c..52bb51f4dc 100644 --- a/jsdoc-conf.json +++ b/jsdoc-conf.json @@ -29,7 +29,7 @@ "template": "./node_modules/clean-jsdoc-theme", "theme_opts": { "default_theme": "dark", - "title": "", + "title": "", "create_style": "header, .sidebar-section-title, .sidebar-title { color: #139cee !important } .logo { margin-left : 40px; margin-right: 40px }" } }, diff --git a/release_docs.sh b/release_docs.sh index a9cc5bf3bc..0c7cc2b395 100755 --- a/release_docs.sh +++ b/release_docs.sh @@ -1,10 +1,17 @@ #!/bin/sh -e set -x +# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh + if [ "${GITHUB_ACTIONS}" = "" ]; then echo "Cannot release docs without GITHUB_ACTIONS set" exit 0; fi +if [ "${SOURCE_TAG}" = "" ]; +then + echo "Cannot release docs without SOURCE_TAG set" + exit 0; +fi REPO="https://github.com/parse-community/parse-server" rm -rf docs @@ -13,20 +20,20 @@ cd docs git pull origin gh-pages cd .. -DEST="master" +RELEASE="release" +VERSION="${SOURCE_TAG}" -if [ "${SOURCE_TAG}" != "" ]; -then - DEST="${SOURCE_TAG}" - # change the default page to the latest - echo "" > "docs/api/index.html" -fi +# change the default page to the latest +echo "" > "docs/api/index.html" npm run definitions npm run docs -mkdir -p "docs/api/${DEST}" -cp -R out/* "docs/api/${DEST}" +mkdir -p "docs/api/${RELEASE}" +cp -R out/* "docs/api/${RELEASE}" + +mkdir -p "docs/api/${VERSION}" +cp -R out/* "docs/api/${VERSION}" # Copy other resources RESOURCE_DIR=".github"