Skip to content

Commit 080fa7d

Browse files
authored
setup docs publishing for observability plugins (#30)
Setup docs publishing of `typedoc` docs for observability plugins. https://github.com/launchdarkly/observability-sdk/actions/runs/14988224734/job/42106099121
1 parent 7fdaa61 commit 080fa7d

File tree

5 files changed

+57
-25
lines changed

5 files changed

+57
-25
lines changed

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

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
name: Manual Publish Package
1+
name: Manual Publish Docs
22
on:
33
workflow_dispatch:
4-
inputs:
5-
dry-run:
6-
description: 'Is this a dry run. If so no package will be published.'
7-
type: boolean
8-
required: true
9-
prerelease:
10-
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
11-
type: boolean
12-
required: true
134

145
permissions:
156
id-token: write
167
contents: write
178
concurrency: ${{ github.workflow }}-${{ github.ref }}
189
jobs:
19-
publish-package:
20-
runs-on: ubuntu-latest
10+
publish-docs:
11+
runs-on: ubuntu-22.04-8core-32gb
2112
steps:
2213
- uses: launchdarkly/common-actions/ssh-key-by-repo@main
2314
with:
@@ -30,22 +21,19 @@ jobs:
3021
GITHUB_TOKEN: ${{ github.token }}
3122
- run: git submodule update --init --recursive
3223

33-
- uses: actions/checkout@v4
34-
with:
35-
path: gh-pages
36-
ref: gh-pages
37-
3824
- name: Setup Node.js environment
3925
uses: actions/setup-node@v4
4026
with:
4127
node-version: lts/*
4228
cache: 'yarn'
4329

4430
- name: Install js dependencies
45-
run: yarn
31+
run: yarn install --mode=skip-build
32+
env:
33+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
4634

4735
- name: Build docs
48-
run: yarn docs
36+
run: yarn docs --filter highlight.run
4937

5038
- uses: launchdarkly/gh-actions/actions/[email protected]
5139
name: 'Publish to Github pages'

.github/workflows/manual-publish.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
name: Manual Publish Package
22
on:
33
workflow_dispatch:
4+
inputs:
5+
dry-run:
6+
description: 'Is this a dry run. If so no package will be published.'
7+
type: boolean
8+
required: true
9+
prerelease:
10+
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
11+
type: boolean
12+
required: true
13+
release_highlight:
14+
description: 'Should release @highlight-run/... packages.'
15+
type: boolean
16+
required: true
17+
release_launchdarkly:
18+
description: 'Should release @launchdarkly/... packages.'
19+
type: boolean
20+
required: true
421

522
permissions:
623
id-token: write
724
contents: write
825
concurrency: ${{ github.workflow }}-${{ github.ref }}
926
jobs:
1027
publish-package:
11-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-22.04-8core-32gb
1229
steps:
1330
- uses: launchdarkly/common-actions/ssh-key-by-repo@main
1431
with:
@@ -28,23 +45,48 @@ jobs:
2845
cache: 'yarn'
2946

3047
- name: Install js dependencies
31-
run: yarn
48+
run: yarn install
3249

33-
- name: Build npm packages
34-
run: yarn build
50+
- name: Build & test
51+
run: yarn test
52+
env:
53+
NEXT_PUBLIC_HIGHLIGHT_PROJECT_ID: 1jdkoe52
54+
REACT_APP_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
55+
56+
- name: Configure yarn npm registry credentials for highlight
57+
if: ${{ inputs.release_highlight == 'true' }}
58+
run: |
59+
yarn config set npmRegistryServer "https://registry.npmjs.org"
60+
yarn config set npmAuthToken "${NPM_TOKEN}"
61+
env:
62+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_HIGHLIGHT_RUN }}
63+
64+
- name: Publish highlight npm packages
65+
if: ${{ inputs.release_highlight == 'true' }}
66+
id: changesets-publish
67+
uses: changesets/action@v1
68+
with:
69+
publish: yarn publish:highlight
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_HIGHLIGHT_RUN }}
73+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_HIGHLIGHT_RUN }}
3574

3675
- uses: launchdarkly/gh-actions/actions/[email protected]
76+
if: ${{ inputs.release_launchdarkly == 'true' }}
3777
name: 'Get NPM token'
3878
with:
3979
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
4080
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
4181

42-
- name: Configure yarn npm registry credentials
82+
- name: Configure yarn npm registry credentials for launchdarkly
83+
if: ${{ inputs.release_launchdarkly == 'true' }}
4384
run: |
4485
yarn config set npmRegistryServer "https://registry.npmjs.org"
4586
yarn config set npmAuthToken "${NODE_AUTH_TOKEN}"
4687
4788
- name: Publish
89+
if: ${{ inputs.release_launchdarkly == 'true' }}
4890
shell: bash
4991
run: |
5092
./scripts/publish-npm.sh

.github/workflows/turbo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cache: 'yarn'
3737

3838
- name: Install js dependencies
39-
run: yarn
39+
run: yarn install
4040

4141
- name: Check yarn for duplicate deps
4242
run: yarn dedupe --check

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"scripts": {
1515
"build": "yarn turbo run build --filter '!@rrweb/web-extension' --filter '!nextjs'",
16+
"docs": "yarn turbo run docs",
1617
"e2e:cloudflare": "yarn turbo run dev --filter cloudflare-worker...",
1718
"e2e:express": "yarn turbo run dev --filter express...",
1819
"e2e:nestjs": "yarn turbo run dev --filter nestjs",

turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
]
3535
},
3636
"docs": {
37+
"dependsOn": ["^build"],
3738
"inputs": [
3839
"src/**/*.tsx",
3940
"src/**/*.ts",

0 commit comments

Comments
 (0)