11name : Manual Publish Docs
22on :
33 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+ - ' sdk/@launchdarkly/observability-python'
13+ - ' sdk/@launchdarkly/observability-react-native'
14+ workflow_call :
15+ inputs :
16+ workspace_path :
17+ description : ' Path to the workspace being released.'
18+ required : true
19+ type : string
420
521permissions :
6- id-token : write
722 contents : write
823concurrency : ${{ github.workflow }}-${{ github.ref }}
924jobs :
@@ -14,23 +29,86 @@ jobs:
1429 uses : actions/checkout@v4
1530 - run : git submodule update --init --recursive
1631
32+ - name : Check if JS package
33+ id : check-js-package
34+ run : |
35+ if ./scripts/is-js-package.sh ${{ inputs.workspace_path }}; then
36+ echo "is_js_package=true" >> $GITHUB_OUTPUT
37+ else
38+ echo "is_js_package=false" >> $GITHUB_OUTPUT
39+ fi
40+
41+ - name : Check if python package
42+ id : check-python-package
43+ run : |
44+ if ./scripts/is-python-package.sh ${{ inputs.workspace_path }}; then
45+ echo "is_python_package=true" >> $GITHUB_OUTPUT
46+ else
47+ echo "is_python_package=false" >> $GITHUB_OUTPUT
48+ fi
49+
1750 - name : Setup Node.js environment
51+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
1852 uses : actions/setup-node@v4
1953 with :
2054 node-version : lts/*
2155 cache : ' yarn'
2256
2357 - name : Install js dependencies
58+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
2459 run : yarn install --mode=skip-build
2560 env :
2661 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD : true
2762
28- - name : Build docs
29- run : yarn docs --filter highlight.run
63+ - name : ' Set WORKSPACE_NAME variable'
64+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
65+ shell : bash
66+ run : |
67+ WORKSPACE_NAME=$(./scripts/package-name.sh ${{ inputs.workspace_path }})
68+ echo "WORKSPACE_NAME=$WORKSPACE_NAME" >> $GITHUB_ENV
69+
70+ - name : Build JS package docs
71+ if : ${{ steps.check-js-package.outputs.is_js_package == 'true' }}
72+ run : yarn docs --filter ${{ env.WORKSPACE_NAME }}
3073
31- -
uses :
launchdarkly/gh-actions/actions/[email protected] 32- name : ' Publish to Github pages'
74+ - uses : actions/setup-python@v5
75+ if : ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
76+ with :
77+ python-version : ' 3.10'
78+
79+ - name : Install poetry
80+ if : ${{ steps.check-python-package.outputs.is_python_package == 'true' }}
81+ uses : abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
82+
83+ - name : Make Install
84+ # Assume non-js projects will use a Makefile to install dependencies.
85+ # Or an empty install target.
86+ if : ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
87+ run : |
88+ cd ${{ inputs.workspace_path }}
89+ make install
90+
91+ - name : Build Makefile Docs
92+ # Assume non-js projects will use a Makefile to build docs.
93+ if : ${{ steps.check-js-package.outputs.is_js_package == 'false' }}
94+ run : |
95+ cd ${{ inputs.workspace_path }}
96+ make docs
97+
98+ - name : Publish Highlight.run as Observability Plugin
99+ if : inputs.workspace_path == 'sdk/highlight-run'
100+ uses :
launchdarkly/gh-actions/actions/[email protected] 33101 with :
34102 docs_path : sdk/highlight-run/docs
35103 output_path : packages/@launchdarkly/observability
36104 github_token : ${{ secrets.GITHUB_TOKEN }}
105+
106+ - name : Publish Docs
107+ # This is generalized to work with any package, but we don't use it for highlight-run,
108+ # because we publish its docs to a different path.
109+ if : inputs.workspace_path != 'sdk/highlight-run'
110+ uses :
launchdarkly/gh-actions/actions/[email protected] 111+ with :
112+ docs_path : ${{ inputs.workspace_path }}/docs
113+ output_path : ${{ inputs.workspace_path }}
114+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments