Skip to content

Commit 5412511

Browse files
committed
Add docs publishing for observability-node.
1 parent 060dfe9 commit 5412511

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed

.github/workflows/manual-publish-docs.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
name: Manual Publish Docs
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
4+
inputs:
5+
workspace_path:
6+
description: 'Path to the workspace being released.'
7+
required: true
8+
type: choice
9+
options:
10+
- sdk/highlight-run
11+
- "sdk/@launchdarkly/observability-node"
12+
workflow_call:
13+
inputs:
14+
workspace_path:
15+
description: 'Path to the workspace being released.'
16+
required: true
17+
type: string
418

519
permissions:
620
id-token: write
@@ -25,12 +39,26 @@ jobs:
2539
env:
2640
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
2741

42+
- name: 'Set WORKSPACE_NAME variable'
43+
shell: bash
44+
run: |
45+
WORKSPACE_NAME=$(./scripts/package-name.sh ${{ inputs.workspace_path }})
46+
echo "WORKSPACE_NAME=$WORKSPACE_NAME" >> $GITHUB_ENV
47+
2848
- name: Build docs
29-
run: yarn docs --filter highlight.run
49+
run: yarn docs --filter ${{ env.WORKSPACE_NAME }}
3050

31-
- uses: launchdarkly/gh-actions/actions/[email protected]
32-
name: 'Publish to Github pages'
51+
- name: Publish Highlight.run as Observability Plugin
52+
if: inputs.workspace_path == 'sdk/highlight-run'
53+
uses: launchdarkly/gh-actions/actions/[email protected]
3354
with:
3455
docs_path: sdk/highlight-run/docs
3556
output_path: packages/@launchdarkly/observability
3657
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Publish other JS packages
60+
if: inputs.workspace_path != 'sdk/highlight-run'
61+
uses: launchdarkly/gh-actions/actions/[email protected]
62+
with:
63+
docs_path: ${{ inputs.workspace_path }}/docs
64+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/turbo.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ jobs:
6262
if: github.ref == 'refs/heads/main'
6363
run: yarn publish:highlight
6464

65+
- name: Publish Highlight.run Docs
66+
if: github.ref == 'refs/heads/main'
67+
uses: ./.github/workflows/manual-publish-docs.yml
68+
with:
69+
workspace_path: sdk/highlight-run
70+
71+
- name: Publish @launchdarkly/observability-node Docs
72+
if: github.ref == 'refs/heads/main'
73+
uses: ./.github/workflows/manual-publish-docs.yml
74+
with:
75+
workspace_path: sdk/@launchdarkly/observability-node
76+
6577
- uses: launchdarkly/gh-actions/actions/[email protected]
6678
if: github.ref == 'refs/heads/main'
6779
name: 'Get NPM token'

scripts/package-name.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Given a path get the name of the package.
2+
# ./scripts/package-name.sh packages/sdk/server-node
3+
# Produces something like:
4+
# @launchdarkly/node-server-sdk
5+
6+
set -e
7+
8+
node -p "require('./$1/package.json').name";

sdk/@launchdarkly/observability-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build": "rollup --config rollup.config.mjs",
1313
"test": "vitest run",
1414
"codegen": "graphql-codegen",
15-
"doc": "typedoc --options ./typedoc.json"
15+
"docs": "typedoc --options ./typedoc.json"
1616
},
1717
"main": "./dist/index.cjs",
1818
"module": "./dist/index.js",

0 commit comments

Comments
 (0)