Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs and Release Fixes #474

Merged
merged 3 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .autorc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"versionFile": "./VERSION",
"publishScript": "./scripts/release.sh",
"publishScriptReleaseTypeArgs": {
"next": ["release"]
"next": ["next"]
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions docs/site/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import { createRoot } from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { RouterProvider, createHashRouter } from "react-router-dom";
import { ChakraProvider } from "@chakra-ui/react";

import { PATH_TO_NAV } from "../config/navigation";
import { Context } from "./Context";

const router = createBrowserRouter([
const router = createHashRouter([
{
path: "/",
Component: React.lazy(() => import("../pages")),
Expand Down
4 changes: 4 additions & 0 deletions docs/site/config/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ const navigation: Navigation = {
title: 'Schema',
path: '/dsl/schema',
},
{
title: 'Plugins',
path: '/dsl/plugins',
},
],
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@player-ui/docs",
"private": true,
"homepage": "https://player-ui.github.io",
"type": "module",
"dependencies": {
"@player-ui/react": "workspace:*",
Expand Down
27 changes: 17 additions & 10 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,55 @@

set -u -o pipefail

readonly PKG_NPM_LABELS=`bazel query --output=label 'kind("npm_package rule", //...) - attr("tags", "\[.*do-not-publish.*\]", //...)'`
NPM_TAG=canary


# Called by auto -- `release` for normal releases or `snapshot` for canary/next.
readonly RELEASE_TYPE=${1:-snapshot}
readonly CURRENT_BRANCH=`git symbolic-ref --short HEAD`

if [ "$RELEASE_TYPE" == "snapshot" ] && [ "$CURRENT_BRANCH" == "main" ]; then
NPM_TAG=canary
if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then
NPM_TAG=next
elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then
# Releases off the main branch are for older majors.
# Don't want to bump the latest tag for those

NPM_TAG=latest
fi

# NPM Publishing
echo "Publishing NPM Packages using tag: ${NPM_TAG} from release type: ${RELEASE_TYPE} on branch: ${CURRENT_BRANCH}"
readonly PKG_NPM_LABELS=`bazel query --output=label 'kind("npm_package rule", //...) - attr("tags", "\[.*do-not-publish.*\]", //...)'`

for pkg in $PKG_NPM_LABELS ; do
bazel run --config=release -- ${pkg}.publish --access public --tag ${NPM_TAG}
done

# Rebuild to stamp the release podspec
bazel build --config=release //:PlayerUI_Podspec //:PlayerUI_Pod

bazel run --config=release //:ios_publish

# Maven Central publishing
bazel run @rules_player//distribution:staged-maven-deploy -- "$RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600
MVN_RELEASE_TYPE=snapshot
if [ "$RELEASE_TYPE" == "next" ] && [ "$CURRENT_BRANCH" == "main" ]; then
MVN_RELEASE_TYPE=release
elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then
MVN_RELEASE_TYPE=release
fi

echo "Publishing Maven Packages with release type: ${MVN_RELEASE_TYPE} on branch: ${CURRENT_BRANCH}"
bazel run @rules_player//distribution:staged-maven-deploy -- "$MVN_RELEASE_TYPE" --package-group=com.intuit.playerui --legacy --client-timeout=600 --connect-timeout=600

# Running this here because it will still have the pre-release version in the VERSION file before auto cleans it up
# Make sure to re-stamp the outputs with the BASE_PATH so nextjs knows what to do with links

# Commented out as it needs to be re-written
if [ "$RELEASE_TYPE" == "snapshot" ] && [ "$CURRENT_BRANCH" == "main" ]; then
# 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 bazel run --verbose_failures --config=release //docs:gh_deploy -- --dest_dir next
elif [ "$RELEASE_TYPE" == "release" ] && [ "$CURRENT_BRANCH" == "main" ]; then
STABLE_DOCS_BASE_PATH=latest bazel run --verbose_failures --config=release //docs:gh_deploy -- --dest_dir latest
fi

# Commented out for now due to failures to deploy
# causes lots of "java.io.IOException: io.grpc.StatusRuntimeException: CANCELLED: Failed to read message." messages in the build
# Also deploy to the versioned folder for main releases
if [ "$RELEASE_TYPE" == "release" ]; then
SEMVER_MAJOR=$(cat VERSION | cut -d. -f1)
Expand Down