Skip to content

Commit 7873ad9

Browse files
authored
Merge pull request #10 from coderpatros/docs
Add initial doc generation and publishing
2 parents d5b7a2f + cd1b558 commit 7873ad9

File tree

5 files changed

+170
-2
lines changed

5 files changed

+170
-2
lines changed

.github/workflows/docs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-documentation:
11+
name: "Build documentation"
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
steps:
15+
- name: Checkout
16+
# see https://github.com/actions/checkout
17+
uses: actions/checkout@v2
18+
- name: Setup Python Environment
19+
# see https://github.com/actions/setup-python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.9
23+
architecture: 'x64'
24+
- name: Install poetry
25+
# see https://github.com/marketplace/actions/setup-poetry
26+
uses: Gr1N/setup-poetry@v7
27+
with:
28+
poetry-version: 1.1.8
29+
- uses: actions/cache@v2
30+
with:
31+
path: ~/.cache/pypoetry/virtualenvs
32+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
33+
- name: Install dependencies
34+
run: poetry install
35+
36+
- name: Build documentation
37+
run: |
38+
poetry run pdoc --html cyclonedx
39+
- name: Deploy documentation
40+
uses: JamesIves/github-pages-deploy-action@releases/v3
41+
with:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
BRANCH: gh-pages
44+
FOLDER: html/cyclonedx

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ venv/*
1818

1919
# Exlude IDE related files
2020
.idea/*
21-
.vscode/*
21+
.vscode/*
22+
23+
# pdoc3 HTML output
24+
html/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ outputter = get_instance(bom=bom, schema_version=SchemaVersion.V1_2)
126126
outputter.output_to_file(filename='/tmp/sbom-v1.2.xml')
127127
```
128128

129+
## Library API Documentation
130+
131+
The Library API Documentation is available online at [https://cyclonedx.github.io/cyclonedx-python-lib/](https://cyclonedx.github.io/cyclonedx-python-lib/).
132+
129133
## Schema Support
130134

131135
This library is a work in progress and complete support for all parts of the CycloneDX schema will come in future releases.

poetry.lock

Lines changed: 117 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ requirements_parser = "^0.2.0"
4343
setuptools = "^50.3.2"
4444
importlib-metadata = "^4.8.1"
4545
toml = "^0.10.2"
46+
pdoc3 = "^0.10.0"
4647

4748
[tool.poetry.dev-dependencies]
4849
tox = "^3.24.3"

0 commit comments

Comments
 (0)