From e873eaa058682ddf943be07b94c6a9e991df9dc2 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Thu, 28 Sep 2023 17:26:51 -0500 Subject: [PATCH 1/2] docs: Generate api documentation for release branch --- release_docs.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/release_docs.sh b/release_docs.sh index 093619783..d0b72f3c4 100755 --- a/release_docs.sh +++ b/release_docs.sh @@ -5,6 +5,11 @@ 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-SDK-JS" rm -rf docs @@ -13,16 +18,16 @@ 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 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}" From d46ed5df3cc6f64c4309d081127ba28c229262c6 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Thu, 28 Sep 2023 17:56:34 -0500 Subject: [PATCH 2/2] add helper script --- release_docs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release_docs.sh b/release_docs.sh index d0b72f3c4..ad0e6cf41 100755 --- a/release_docs.sh +++ b/release_docs.sh @@ -1,5 +1,7 @@ #!/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"