Skip to content

Commit

Permalink
Merge pull request #558 from player-ui/maint/more-release-fixes
Browse files Browse the repository at this point in the history
More Release Fixes
  • Loading branch information
KetanReddy authored Dec 4, 2024
2 parents b29ae95 + f419510 commit 94d37fc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
2 changes: 2 additions & 0 deletions docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
14 changes: 2 additions & 12 deletions docs/site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion scripts/next-changelogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
});
}
Expand Down
20 changes: 16 additions & 4 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion scripts/workspace-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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"

0 comments on commit 94d37fc

Please sign in to comment.