From 71e33f8b842116fcca29bd8a4c6fcc83c2ec8b42 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 4 Dec 2024 09:26:01 -0800 Subject: [PATCH 1/2] Fix changelog push --- scripts/next-changelogs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/next-changelogs.js b/scripts/next-changelogs.js index ceaf9bb07..d99c44aab 100644 --- a/scripts/next-changelogs.js +++ b/scripts/next-changelogs.js @@ -27,7 +27,7 @@ class NextChangelogsPlugin { ); } else { await auto.changelog({ from: latestRelease }); - await await execPromise("git", ["push", auto.remote, auto.baseBranch]); + execSync(`git push ${auto.remote} ${auto.baseBranch}`); } }); } From f419510c792642bb4651bb2cebdeeb9e1ef223d5 Mon Sep 17 00:00:00 2001 From: Ketan Reddy Date: Wed, 4 Dec 2024 11:04:42 -0800 Subject: [PATCH 2/2] Fix stamping of search config for latest doc site releases --- docs/BUILD | 2 ++ docs/site/astro.config.mjs | 14 ++------------ scripts/next-changelogs.js | 2 +- scripts/release.sh | 20 ++++++++++++++++---- scripts/workspace-status.sh | 4 +++- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/BUILD b/docs/BUILD index eb279f05c..f6571b0ff 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -28,6 +28,8 @@ stamp_tar_files( "NEXT_PUBLIC_GA_MEASUREMENT_ID": "{STABLE_GA_MEASUREMENT_ID}", "DOCS_BASE_PATH": "{STABLE_DOCS_BASE_PATH}", "ALGOLIA_SEARCH_API_KEY": "{STABLE_ALGOLIA_SEARCH_API_KEY}", + "ALGOLIA_SEARCH_APPID": "{STABLE_ALGOLIA_SEARCH_APPID}", + "ALGOLIA_SEARCH_INDEX": "{STABLE_ALGOLIA_SEARCH_INDEX}", }, stable = True ) diff --git a/docs/site/astro.config.mjs b/docs/site/astro.config.mjs index a4cb197ce..f206a2340 100644 --- a/docs/site/astro.config.mjs +++ b/docs/site/astro.config.mjs @@ -33,17 +33,6 @@ export const rehypeLinks = (options) => { export const BASE_PREFIX = process.env.NODE_ENV === "production" ? "DOCS_BASE_PATH" : undefined; -export const SEARCH_CONFIG = - BASE_PREFIX === "latest" - ? { - appId: "OX3UZKXCOH", - indexName: "player-ui", - } - : { - appId: "D477I7TDXB", - indexName: "crawler_Player (Next)", - }; - // https://astro.build/config export default defineConfig({ integrations: [ @@ -72,7 +61,8 @@ export default defineConfig({ plugins: [ starlightDocSearch({ apiKey: "ALGOLIA_SEARCH_API_KEY", - ...SEARCH_CONFIG, + appId: "ALGOLIA_SEARCH_APPID", + indexName: "ALGOLIA_SEARCH_INDEX", }), ], sidebar: [ diff --git a/scripts/next-changelogs.js b/scripts/next-changelogs.js index d99c44aab..90b7e43b8 100644 --- a/scripts/next-changelogs.js +++ b/scripts/next-changelogs.js @@ -27,7 +27,7 @@ class NextChangelogsPlugin { ); } else { await auto.changelog({ from: latestRelease }); - execSync(`git push ${auto.remote} ${auto.baseBranch}`); + execSync(`git push ${auto.remote} ${auto.baseBranch}`); } }); } diff --git a/scripts/release.sh b/scripts/release.sh index f1ba15610..57f0632d5 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -46,14 +46,26 @@ bazel run @rules_player//distribution:staged-maven-deploy -- "$MVN_RELEASE_TYPE" # Docs publishing echo "Publishing Docs with release type: ${RELEASE_TYPE} on branch: ${CURRENT_BRANCH}" -if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then - STABLE_DOCS_BASE_PATH=next STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_NEXT_SEARCH_API_KEY bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir next +if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then + STABLE_DOCS_BASE_PATH="next" \ + STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_NEXT_SEARCH_API_KEY \ + STABLE_ALGOLIA_SEARCH_APPID="D477I7TDXB" \ + STABLE_ALGOLIA_SEARCH_INDEX="crawler_Player (Next)" \ + bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir next elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then - STABLE_DOCS_BASE_PATH=latest STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_SEARCH_API_KEY bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir latest + STABLE_DOCS_BASE_PATH="latest" \ + STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_SEARCH_API_KEY \ + STABLE_ALGOLIA_SEARCH_APPID="OX3UZKXCOH" \ + STABLE_ALGOLIA_SEARCH_INDEX="player-ui" \ + bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir latest fi # Also deploy to the versioned folder for main releases if [ "$RELEASE_TYPE" == "release" ]; then SEMVER_MAJOR=$(cat VERSION | cut -d. -f1) - STABLE_DOCS_BASE_PATH=$SEMVER_MAJOR STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_SEARCH_API_KEY bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir "$SEMVER_MAJOR" + STABLE_DOCS_BASE_PATH=$SEMVER_MAJOR \ + STABLE_ALGOLIA_SEARCH_API_KEY=$ALGOLIA_SEARCH_API_KEY \ + STABLE_ALGOLIA_SEARCH_APPID="OX3UZKXCOH" \ + STABLE_ALGOLIA_SEARCH_INDEX="player-ui" \ + bazel run --verbose_failures --config=ci //docs:gh_deploy -- --dest_dir "$SEMVER_MAJOR" fi diff --git a/scripts/workspace-status.sh b/scripts/workspace-status.sh index a50dd8f30..68136c1d8 100755 --- a/scripts/workspace-status.sh +++ b/scripts/workspace-status.sh @@ -16,4 +16,6 @@ echo "GIT_TREE_STATUS $git_tree_status" echo "STABLE_GA_MEASUREMENT_ID $NEXT_PUBLIC_GA_MEASUREMENT_ID" echo "STABLE_DOCS_BASE_PATH $STABLE_DOCS_BASE_PATH" -echo "STABLE_ALGOLIA_SEARCH_API_KEY $STABLE_ALGOLIA_SEARCH_API_KEY" \ No newline at end of file +echo "STABLE_ALGOLIA_SEARCH_API_KEY $STABLE_ALGOLIA_SEARCH_API_KEY" +echo "STABLE_ALGOLIA_SEARCH_INDEX $STABLE_ALGOLIA_SEARCH_INDEX" +echo "STABLE_ALGOLIA_SEARCH_APPID $STABLE_ALGOLIA_SEARCH_APPID" \ No newline at end of file