Skip to content
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
18 changes: 18 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,21 @@ jobs:
name: JSON-Schema-documentation
path: docgen/json/docs
if-no-files-found: error
docs_proto:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docgen/proto
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v4
- name: Generate Schema documentation
run: ./gen.sh
- name: Archive Schema documentation
# https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v4
with:
name: PROTO-Schema-documentation
path: docgen/proto/docs
if-no-files-found: error
1 change: 1 addition & 0 deletions docgen/proto/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/docs/
43 changes: 43 additions & 0 deletions docgen/proto/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
set -eu

THIS_PATH="$(realpath "$(dirname "$0")")"
SCHEMA_PATH="$(realpath "$THIS_PATH/../../schema")"
DOCS_PATH="$THIS_PATH/docs"
TEMPLATES_PATH="$THIS_PATH/templates"

PROTOC_GEN_DOC_VERSION='1.5.1'

# --

rm -f -R "$DOCS_PATH"

generate () {
version="$1"
title="CycloneDX v$version Proto Reference"
echo "Generating: $title"

OUT_DIR="$DOCS_PATH/$version/proto/"
mkdir -p "$OUT_DIR"

## docs: https://github.com/pseudomuto/protoc-gen-doc
docker run --rm \
-v "${OUT_DIR}:/out" \
-v "${SCHEMA_PATH}:/protos:ro" \
-v "${TEMPLATES_PATH}:/templates:ro" \
"pseudomuto/protoc-gen-doc:${PROTOC_GEN_DOC_VERSION}" \
--doc_opt=/templates/html.tmpl,index.html \
"bom-${version}.proto"

# fix file permissions
docker run --rm \
-v "${OUT_DIR}:/out" \
--entrypoint chown \
"pseudomuto/protoc-gen-doc:${PROTOC_GEN_DOC_VERSION}" \
"$(id -g):$(id -u)" -R /out
}

generate 1.3
generate 1.4
generate 1.5
generate 1.6
Loading
Loading